From esg at unife.it Fri May 9 23:35:05 2014 From: esg at unife.it (Josef Eschgfaeller) Date: Fri, 9 May 2014 23:35:05 +0200 Subject: [Tkinter-discuss] Different fonts in 3.3? Message-ID: Trying to pass from Python 3.1 to 3.3 I have a problem with Tkinter: fonts (or spacings) in 3.3 seem to be higher, so that after instructions like A=tkinter.Text(B,width=36,height=27,...) the text widget requires more space than before with 3.1. I have Mac OS X 10.6.8 and call Python from a script using #! /Library/Frameworks/Python.framework\ /Versions/3.x/bin/python3 It seems also that the letters are a bit uglier, somewhat more compressed. Thanks Josef Eschgfaeller From nad at acm.org Sat May 10 21:30:42 2014 From: nad at acm.org (Ned Deily) Date: Sat, 10 May 2014 12:30:42 -0700 Subject: [Tkinter-discuss] Different fonts in 3.3? References: Message-ID: In article , Josef Eschgfaeller wrote: > Trying to pass from Python 3.1 to 3.3 I have > a problem with Tkinter: fonts (or spacings) > in 3.3 seem to be higher, so that after > instructions like > > A=tkinter.Text(B,width=36,height=27,...) > > the text widget requires more space than > before with 3.1. I have Mac OS X 10.6.8 and > call Python from a script using > > #! /Library/Frameworks/Python.framework\ > /Versions/3.x/bin/python3 > > It seems also that the letters are a bit uglier, > somewhat more compressed. Chances are that the difference is not in Python itself but in the versions of Tk that the two Pythons are linked with. I wouldn't be surprised to find that the 3.1 version is linked with Tk 8.4 and 3.3 is with Tk 8.5. One way to check is: $ otool -L $(python3.3 -c 'import _tkinter;print(_tkinter.__file__)') /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynlo ad/_tkinter.so: /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.15) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.15) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) If you are using the python.org 3.3, please be sure to follow the README instructions to install a new version of Tcl/Tk 8.5 (like the ActiveTcl one); the Apple-supplied system Tcl/Tk 8.5 in OS X 10.6 was new and very buggy. -- Ned Deily, nad at acm.org From alan.gauld at btinternet.com Tue May 13 20:51:25 2014 From: alan.gauld at btinternet.com (Alan Gauld) Date: Tue, 13 May 2014 19:51:25 +0100 Subject: [Tkinter-discuss] How to enable/disable a menu? Message-ID: I have an app with a tabbed notebook. I want to only enable one of the main menus when the appropriate tab is selected. When the tab is deselected I want to disable the menu again. I can't see any obvious properties in the Menu object. I can mess around with flags in the event handlers and change the menu font colours etc but that's pretty horrible. Is there anything better? Using Python 3.3; on Linux and Windows 8 if it makes any difference. TIA -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos From alejandroautalan at gmail.com Wed May 14 03:21:39 2014 From: alejandroautalan at gmail.com (Alejandro Autalan) Date: Tue, 13 May 2014 22:21:39 -0300 Subject: [Tkinter-discuss] How to enable/disable a menu? In-Reply-To: References: Message-ID: 2014-05-13 15:51 GMT-03:00 Alan Gauld : > I have an app with a tabbed notebook. I want to > only enable one of the main menus when the appropriate > tab is selected. When the tab is deselected I want > to disable the menu again. > > I can't see any obvious properties in the Menu > object. I can mess around with flags in the event > handlers and change the menu font colours etc but > that's pretty horrible. Is there anything better? > > Using Python 3.3; on Linux and Windows 8 if it makes > any difference. > > TIA > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.flickr.com/photos/alangauldphotos > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss Hello, You can use the 'state' option of the menuitem. Here's an example: http://linkode.org/tE01VF7sGPOXjvsWymBqi4 Regards Alejandro A. From bouncingcats at gmail.com Wed May 14 05:06:10 2014 From: bouncingcats at gmail.com (David) Date: Wed, 14 May 2014 13:06:10 +1000 Subject: [Tkinter-discuss] How to enable/disable a menu? In-Reply-To: References: Message-ID: On 14 May 2014 11:21, Alejandro Autalan wrote: > Here's an example: http://linkode.org/tE01VF7sGPOXjvsWymBqi4 Quoting http://linkode.org/about: "It's a kind of short living collaboration space, a dynamic pastebin." When communicating on a *public mailing list*, please include all relevant information *in the email message* where possible, to maintain the integrity of the message, and the list archive. This shows consideration to present-day readers who may not have access to other protocols like http, and also to readers of the list archive in the future, when the backers of some transient pastebin site may well have abandoned it. import tkinter as tk root = tk.Tk() menu = tk.Menu(root) mfile = tk.Menu(menu) mfile.add_command(label='Option 1') medit = tk.Menu(menu) medit.add_command(label='Option2') menu.add_cascade(label='File', menu=mfile) menu.add_cascade(label='Edit', menu=medit, state=tk.DISABLED) root.configure(menu=menu) #cb enabled = False def on_button_click(): global enabled if enabled: enabled = False menu.entryconfigure(2, state=tk.DISABLED) else: enabled = True menu.entryconfigure(2, state=tk.NORMAL) #button b = tk.Button(root, text='Enable', command=on_button_click) b.grid(padx=60, pady=20) root.mainloop() From bryan.oakley at gmail.com Wed May 14 14:48:43 2014 From: bryan.oakley at gmail.com (Bryan Oakley) Date: Wed, 14 May 2014 07:48:43 -0500 Subject: [Tkinter-discuss] How to enable/disable a menu? In-Reply-To: References: Message-ID: You can disable the button or menu item the menu is associated with, and that will disable the whole menu. --bryan > On May 13, 2014, at 1:51 PM, Alan Gauld wrote: > > I have an app with a tabbed notebook. I want to > only enable one of the main menus when the appropriate > tab is selected. When the tab is deselected I want > to disable the menu again. > > I can't see any obvious properties in the Menu > object. I can mess around with flags in the event > handlers and change the menu font colours etc but > that's pretty horrible. Is there anything better? > > Using Python 3.3; on Linux and Windows 8 if it makes > any difference. > > TIA > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.flickr.com/photos/alangauldphotos > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss From alan.gauld at btinternet.com Wed May 14 17:59:35 2014 From: alan.gauld at btinternet.com (ALAN GAULD) Date: Wed, 14 May 2014 16:59:35 +0100 (BST) Subject: [Tkinter-discuss] How to enable/disable a menu? In-Reply-To: References: Message-ID: <1400083175.92963.YahooMailNeo@web186001.mail.ir2.yahoo.com> >You can disable the button or menu item the menu is associated with, and that will disable the whole menu.?Thats what I assumed but which proprerty disables a menu - or any other widget for that matter?? I'm assuming its an inherited atttribute of some sort? Alan G -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryan.oakley at gmail.com Wed May 14 18:25:10 2014 From: bryan.oakley at gmail.com (Bryan Oakley) Date: Wed, 14 May 2014 11:25:10 -0500 Subject: [Tkinter-discuss] How to enable/disable a menu? In-Reply-To: <1400083175.92963.YahooMailNeo@web186001.mail.ir2.yahoo.com> References: <1400083175.92963.YahooMailNeo@web186001.mail.ir2.yahoo.com> Message-ID: The "state" attribute. Here's a working example: import Tkinter as tk root = tk.Tk() menubar = tk.Menu(root) root.configure(menu=menubar) exampleMenu = tk.Menu(root) exampleMenu.add_command(label="One") exampleMenu.add_command(label="Two") exampleMenu.add_command(label="Three") menubar.add_cascade(label="Example", menu=exampleMenu) menubar.entryconfigure("Example", state="disabled") root.mainloop() On Wed, May 14, 2014 at 10:59 AM, ALAN GAULD wrote: > > > You can disable the button or menu item the menu is associated with, and > that will disable the whole menu. > > Thats what I assumed but which proprerty disables a menu - or any other > widget for that matter? > I'm assuming its an inherited atttribute of some sort? > > Alan G > -------------- next part -------------- An HTML attachment was scrubbed... URL: From esg at unife.it Thu May 15 00:22:11 2014 From: esg at unife.it (Josef Eschgfaeller) Date: Thu, 15 May 2014 00:22:11 +0200 Subject: [Tkinter-discuss] Different fonts in 3.3? Message-ID: Ned Deily wrote: > I wouldn't be surprised to find that the 3.1 version > is linked with Tk 8.4 and 3.3 is with Tk 8.5. Yes. I find this with tkinter.Tcl().eval('info patchlevel') which gives 8.4.19 and 8.5.15. > the Apple-supplied system Tcl/Tk 8.5 I installed today Python 3.4. But some time ago I installed ActiveTcl 8.6, which in the Frameworks directory is also Current. Does this mean, that the new Python 3.4 has been installed with Apple's Tcl and not with the ActiveTcl version? Thanks Josef Eschgfaeller From alan.gauld at btinternet.com Thu May 15 01:01:53 2014 From: alan.gauld at btinternet.com (ALAN GAULD) Date: Thu, 15 May 2014 00:01:53 +0100 (BST) Subject: [Tkinter-discuss] How to enable/disable a menu? In-Reply-To: References: <1400083175.92963.YahooMailNeo@web186001.mail.ir2.yahoo.com> Message-ID: <1400108513.87072.YahooMailNeo@web186005.mail.ir2.yahoo.com> Thanks Bryan,? I played around with that and its exactly what I needed. Thanks to all who sent comments. ? Alan Gauld Author of the Learn To Program website http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos >________________________________ > From: Bryan Oakley >To: ALAN GAULD >Cc: "tkinter-discuss at python.org" >Sent: Wednesday, 14 May 2014, 17:25 >Subject: Re: [Tkinter-discuss] How to enable/disable a menu? > > > >The "state" attribute. > > >Here's a working example: > > >import Tkinter as tk > > >root = tk.Tk() >menubar = tk.Menu(root) >root.configure(menu=menubar) > > >exampleMenu = tk.Menu(root) >exampleMenu.add_command(label="One") >exampleMenu.add_command(label="Two") >exampleMenu.add_command(label="Three") >menubar.add_cascade(label="Example", menu=exampleMenu) > > >menubar.entryconfigure("Example", state="disabled") > > >root.mainloop() > > > > > >On Wed, May 14, 2014 at 10:59 AM, ALAN GAULD wrote: > > >> >> >>>You can disable the button or menu item the menu is associated with, and that will disable the whole menu.?Thats what I assumed but which proprerty disables a menu - or any other widget for that matter?? >>I'm assuming its an inherited atttribute of some sort? >> >> >> >>Alan G > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Thu May 15 03:17:34 2014 From: nad at acm.org (Ned Deily) Date: Wed, 14 May 2014 18:17:34 -0700 Subject: [Tkinter-discuss] Different fonts in 3.3? References: Message-ID: In article , Josef Eschgfaeller wrote: > I installed today Python 3.4. But some time > ago I installed ActiveTcl 8.6, which in the > Frameworks directory is also Current. > > Does this mean, that the new Python 3.4 > has been installed with Apple's Tcl and > not with the ActiveTcl version? Python builds link with a specific version of Tk. The python.org 64-bit installers for OS X link with a framework Tk 8.5, like current ActiveTcl 8.5.x and the buggy Apple-supplied system Tk 8.5.x. You can install both ActiveTcl 8.5.x and 8.6.x on OS X. The python.org Python will automatically use the ActiveTcl 8.5 once it is installed. More details here: https://www.python.org/download/mac/tcltk/ -- Ned Deily, nad at acm.org From nad at acm.org Thu May 15 03:22:04 2014 From: nad at acm.org (Ned Deily) Date: Wed, 14 May 2014 18:22:04 -0700 Subject: [Tkinter-discuss] Different fonts in 3.3? References: Message-ID: In article , Josef Eschgfaeller wrote: > Yes. I find this with tkinter.Tcl().eval('info patchlevel') > which gives 8.4.19 and 8.5.15. > > > the Apple-supplied system Tcl/Tk 8.5 > > I installed today Python 3.4. But some time > ago I installed ActiveTcl 8.6, which in the > Frameworks directory is also Current. > > Does this mean, that the new Python 3.4 > has been installed with Apple's Tcl and > not with the ActiveTcl version? Ah, sorry, I overlooked the "8.5.15" above. That seems to indicate that you've already installed ActiveTcl 8.5.15. The fact that you've installed ActiveTcl 8.6.x, which changed the Current link in the Tcl and Tk frameworks, has no effect on which version a particular Python dynamically links to at run time. The Current link affects building _tkinter, not running it. -- Ned Deily, nad at acm.org From kw at codebykevin.com Thu May 15 03:42:09 2014 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 14 May 2014 21:42:09 -0400 Subject: [Tkinter-discuss] Different fonts in 3.3? In-Reply-To: References: Message-ID: <53741B71.2040205@codebykevin.com> On 5/14/14, 6:22 PM, Josef Eschgfaeller wrote: > Ned Deily wrote: > >> I wouldn't be surprised to find that the 3.1 version >> is linked with Tk 8.4 and 3.3 is with Tk 8.5. > > Yes. I find this with tkinter.Tcl().eval('info patchlevel') > which gives 8.4.19 and 8.5.15. > >> the Apple-supplied system Tcl/Tk 8.5 > > I installed today Python 3.4. But some time > ago I installed ActiveTcl 8.6, which in the > Frameworks directory is also Current. If I understand you correctly, you have Python 3.1 which is linked with Tk 8.4, and you have just installed Python 3.4, which is linked with Tk 8.5, and you see a difference in the fonts? The most likely reason for this is that Tk 8.4 is built on the deprecated Carbon framework, which uses a deprecated font engine called ATUSI. The version of Tk 8.5 that you are using is built on the Cocoa framework, which uses the modern CoreText font rendering engine. I'm not sure of all the low-level differences between CoreText and ATUSI, but there may very well be some subtle differences in how they look. I was also going to ask if you are running on a Retina Display, which can affect text rendering, but that may not be relevant here. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From esg at unife.it Thu May 15 20:32:02 2014 From: esg at unife.it (Josef Eschgfaeller) Date: Thu, 15 May 2014 20:32:02 +0200 Subject: [Tkinter-discuss] Different fonts in 3.3? In-Reply-To: <53741B71.2040205@codebykevin.com> References: <53741B71.2040205@codebykevin.com> Message-ID: Ned Deily wrote: > Ah, sorry, I overlooked the "8.5.15" above. > That seems to indicate that you've already installed > ActiveTcl 8.5.15. The fact that you've installed > ActiveTcl 8.6.x, which changed the Current link > in the Tcl and Tk frameworks, has no effect on > which version a particular Python dynamically links > to at run time. The Current link affects building > _tkinter, not running it. This is not clear to me. I had previously installed both Tcl 8.5 and 8.6. Yesterday I installed Python 3.4. Why did it not choose Tcl 8.6? Not a Tkinter question: My Python Current link points still to 2.7. Has this any meaning? Kevin Walzer wrote: > The most likely reason for this is that Tk 8.4 is > built on the deprecated Carbon framework, which > uses a deprecated font engine called ATUSI. The differences are shown in felix.unife.it/++/tmp My doubt is still, whether this Tk 8.5 is now the right one. In that case I would simple change the height of the text widgets. As you notice in 8.5 there appears also a border on the selected list element, which I do not like too much, but it is not important. Thanks Josef Eschgfaeller From nad at acm.org Fri May 16 10:09:53 2014 From: nad at acm.org (Ned Deily) Date: Fri, 16 May 2014 01:09:53 -0700 Subject: [Tkinter-discuss] Different fonts in 3.3? References: <53741B71.2040205@codebykevin.com> Message-ID: In article , Josef Eschgfaeller wrote: > Ned Deily wrote: > > Ah, sorry, I overlooked the "8.5.15" above. > > That seems to indicate that you've already installed > > ActiveTcl 8.5.15. The fact that you've installed > > ActiveTcl 8.6.x, which changed the Current link > > in the Tcl and Tk frameworks, has no effect on > > which version a particular Python dynamically links > > to at run time. The Current link affects building > > _tkinter, not running it. > This is not clear to me. I had previously installed > both Tcl 8.5 and 8.6. Yesterday I installed Python 3.4. > Why did it not choose Tcl 8.6? Because Python's _tkinter C extension is built and linked with a particular compatibility version of Tk, i.e, the major version of Tcl and Tk are determined when Python itself is built, not when Python is installed or run. Note the absolute path to the Tcl and Tk framework shared libraries: they both have explicit "8.5" values and not "Current". $ otool -L $(/usr/local/bin/python3.4 -c 'import _tkinter; print(_tkinter.__file__)') /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynlo ad/_tkinter.so: /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.15) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.15) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) > Not a Tkinter question: My Python Current link > points still to 2.7. Has this any meaning? As far as I know, the only practical effect the value of Current has is when you compile or link a C program which uses "-framework Python". The various compiler and linker components that support '-framework" will use the Current link in the selected framework. When the program is linked, the resolved path to the framework shared library is embedded in the linker output file (executable, bundle, etc) as seen above with otool -L. -- Ned Deily, nad at acm.org From Vasilis.Vlachoudis at cern.ch Tue May 20 15:20:48 2014 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Tue, 20 May 2014 13:20:48 +0000 Subject: [Tkinter-discuss] Transient, grab and focus problems... Message-ID: <0BC70B5D93E054469872FFD0FE07220EC09855D3@CERNXCHG52.cern.ch> Dear all in my application I have some toplevels that appear as InPlaceEdit for Listboxes when the user clicks a field in a listbox. This time I've tried to create a 2 nested level toplevel, but I am completely losing the focus on the return and I didn't find any way to restore it. Bellow there is a small example just to demonstrate the problem By clicking the button it opens a toplevel, transient, overrideredirect(1) with a Text() which has the grab and the focus. Once you press a certain key (now the +) it opens a second level, another toplevel of a listbox with override and grab On return from the second toplevel the focus is completly lost. I cannot restore the focus on the text, I've tried to use focus_set(), grab_set etc.. but with no success. Any ideas? Where did the focus go and how why the focus_set() doesn't work Thanks in advance Vasilis from Tkinter import * # ======================================================== class TopList(Toplevel): def __init__(self, master): Toplevel.__init__(self, master) self.overrideredirect(1) self.transient(master) self.bind("", self.close) self.l = Listbox(self, bg="Yellow") self.l.pack() self.l.bind("", self.close) for item in ["one","two","three","four"]: self.l.insert(END,item) self.result = "" # ------------------------------------------------ def show(self): self.deiconify() self.wait_visibility() self.grab_set() self.l.focus_set() self.wait_window() self.grab_release() return self.result # ------------------------------------------------ def close(self, event=None): if event: self.result = self.l.get(self.l.nearest(event.y)) else: self.result = self.l.get(ACTIVE) self.destroy() # ======================================================== class TopText(Toplevel): def __init__(self, master): Toplevel.__init__(self, master) self.overrideredirect(1) self.transient(master) self.bind("", self.close) self.t = Text(self, bg="White") self.t.pack() self.t.bind("", self.openList) self.result = "" # ------------------------------------------------ def show(self): self.deiconify() self.wait_visibility() self.grab_set() self.t.focus_set() self.wait_window() return self.result # ------------------------------------------------ def close(self, event=None): self.result = self.t.get(1.0,END) self.destroy() # ------------------------------------------------ def openList(self, event=None): self.grab_release() result = TopList(self).show() self.t.focus_set() self.grab_set() self.t.insert("%s + 1 chars"%(INSERT),result) # ======================================================== def openText(): print TopText(tk).show() tk = Tk() e = Entry(tk) e.pack() e.focus_set() b = Button(tk, text="Text", command=openText) b.pack() tk.mainloop() -------------- next part -------------- An HTML attachment was scrubbed... URL: From Vasilis.Vlachoudis at cern.ch Tue May 20 16:16:51 2014 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Tue, 20 May 2014 14:16:51 +0000 Subject: [Tkinter-discuss] Transient, grab and focus problems... In-Reply-To: <0BC70B5D93E054469872FFD0FE07220EC09855D3@CERNXCHG52.cern.ch> References: <0BC70B5D93E054469872FFD0FE07220EC09855D3@CERNXCHG52.cern.ch> Message-ID: <0BC70B5D93E054469872FFD0FE07220EC098769B@CERNXCHG52.cern.ch> Ok I think I found the problem/solution. After closing the toplevel with overrideredirect(() the whole application is losing the focus, hence a simple focus_set() is not sufficient. If I do a focus_force() on the toplevel then it works V. ________________________________ From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Vasilis Vlachoudis [Vasilis.Vlachoudis at cern.ch] Sent: 20 May 2014 15:20 To: tkinter-discuss at python.org Subject: [Tkinter-discuss] Transient, grab and focus problems... Dear all in my application I have some toplevels that appear as InPlaceEdit for Listboxes when the user clicks a field in a listbox. This time I've tried to create a 2 nested level toplevel, but I am completely losing the focus on the return and I didn't find any way to restore it. Bellow there is a small example just to demonstrate the problem By clicking the button it opens a toplevel, transient, overrideredirect(1) with a Text() which has the grab and the focus. Once you press a certain key (now the +) it opens a second level, another toplevel of a listbox with override and grab On return from the second toplevel the focus is completly lost. I cannot restore the focus on the text, I've tried to use focus_set(), grab_set etc.. but with no success. Any ideas? Where did the focus go and how why the focus_set() doesn't work Thanks in advance Vasilis from Tkinter import * # ======================================================== class TopList(Toplevel): def __init__(self, master): Toplevel.__init__(self, master) self.overrideredirect(1) self.transient(master) self.bind("", self.close) self.l = Listbox(self, bg="Yellow") self.l.pack() self.l.bind("", self.close) for item in ["one","two","three","four"]: self.l.insert(END,item) self.result = "" # ------------------------------------------------ def show(self): self.deiconify() self.wait_visibility() self.grab_set() self.l.focus_set() self.wait_window() self.grab_release() return self.result # ------------------------------------------------ def close(self, event=None): if event: self.result = self.l.get(self.l.nearest(event.y)) else: self.result = self.l.get(ACTIVE) self.destroy() # ======================================================== class TopText(Toplevel): def __init__(self, master): Toplevel.__init__(self, master) self.overrideredirect(1) self.transient(master) self.bind("", self.close) self.t = Text(self, bg="White") self.t.pack() self.t.bind("", self.openList) self.result = "" # ------------------------------------------------ def show(self): self.deiconify() self.wait_visibility() self.grab_set() self.t.focus_set() self.wait_window() return self.result # ------------------------------------------------ def close(self, event=None): self.result = self.t.get(1.0,END) self.destroy() # ------------------------------------------------ def openList(self, event=None): self.grab_release() result = TopList(self).show() self.t.focus_set() self.grab_set() self.t.insert("%s + 1 chars"%(INSERT),result) # ======================================================== def openText(): print TopText(tk).show() tk = Tk() e = Entry(tk) e.pack() e.focus_set() b = Button(tk, text="Text", command=openText) b.pack() tk.mainloop() -------------- next part -------------- An HTML attachment was scrubbed... URL: