473,388 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Copy paste in entry widget

Hi,
is copy, paste, cut of selection possible in entry widget? Docs say
selection must be copied by default, in my programm it doesn't work.
Regards, M.O.

Jul 19 '05 #1
4 6201

Michael> is copy, paste, cut of selection possible in entry widget? Docs
Michael> say selection must be copied by default, in my programm it
Michael> doesn't work.

What platform? What GUI toolkit?

--
Skip Montanaro
sk**@pobox.com
Jul 19 '05 #2
VK
Skip Montanaro wrote:
Michael> is copy, paste, cut of selection possible in entry widget? Docs
Michael> say selection must be copied by default, in my programm it
Michael> doesn't work.

What platform? What GUI toolkit?


Linux, Windows. TkInter, Pmw.
I've already implemented this with code under my message, but "cut"
copies entrytext, without deleting selection. Any ideas

def copy(self):
global copied
if self.entry.selection_present():
self.entry.clipboard_clear()
copied = self.entry.selection_get()
self.entry.bell()
def paste(self):
self.entry.insert(END, copied)
def cut(self):
global copied
self.entry.clipboard_clear()
if self.entry.selection_present():
copied = self.entry.selection_get()
self.entry.selection_clear()
self.entry.bell
Jul 19 '05 #3
I need it for Linux, so far only TkInter used.

Jul 19 '05 #4
VK
Michael Onfrek wrote:
Hi,
is copy, paste, cut of selection possible in entry widget? Docs say
selection must be copied by default, in my programm it doesn't work.
Regards, M.O.

Hear it is

def paste(self):
self.entry.event_generate('<Control-v>')
def cut(self):
self.entry.event_generate('<Control-x>')
def copy(self):
self.entry.event_generate('<Control-c>')
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mickel Grönroos | last post by:
Hi, I'm trying to put an Tkinter.Entry of fixed size onto a specific location on a canvas using the place manager. The idea is that one can double-click a rectangle object on a canvas to get an...
3
by: Phil Schmidt | last post by:
I'm trying to make a custom entry widget, as in the code that follows. There are two problems I'm trying to fix: 1) I would like the widget to behave as myEntry.Escape() does now, except that it...
4
by: Clara | last post by:
Hi, can somebody help me,..I have an assignment due next week but now I'm stuck with this problem.... I tried to get values from entry widget using the widgetcontrolvariable.get(),..but it seems...
7
by: William Gill | last post by:
Is there a simple way to cut and paste from a tkinter text widget to an entry widget? I know I could create a mouse button event that triggers a popup (message widget) prompting for cut/paste in...
10
by: Russell Shaw | last post by:
Hi, How do i easily assign one struct to another of a different type? struct Object object = allocate_object(); struct Widget widget = (struct Widget)object; /* doesn't work */ struct...
2
by: Dustan | last post by:
How do I limit what the user can enter in an Entry Widget? I know I can set it to display '*' to hide a password, but what I want to do is limit the contents to numeric characters. What is the...
5
by: Kaur | last post by:
Hi, I have been successful copying a vba code from one of your posts on how to copy and paste a record by declaring the desired fields that needs to be copied in form's declaration and creating two...
4
by: Dustan | last post by:
Back in this post, I attempted to make a label look like a button:...
2
Strider1066
by: Strider1066 | last post by:
Is it a bug or a feature? I'm trying to sub-class an Entry widget that displays a template (i.e. '____-__-__') for users and does keystroke validation. It is starting to work but with one problem....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.