Tkinter, tkFileDialog, and checkbuttons
Michael Peuser
mpeuser at web.de
Sun Oct 5 07:39:32 EDT 2003
> "Frank Chen" <jsfrank.chen at msa.hinet.net>
> Now please select 'New Window', which will cause App class
> to generate a child root derived from Tk(). The status of the
> checkbuttons becomes unselected.
All checkbuttons use the same variable, try:
self.checkmark=StringVar()
self.menu.menu.add_checkbutton(label='Show tool bar', underline=0,
variable=self.checkmark,
> And if you select 'Open File' of child root window, the main root
> Tk() will be popped up to the layer above child root.
Try:
tkFileDialog.askopenfilename(
parent=self.master,
Kindly
MichaelP
BTW there are a lot of questionable constructs in your program. You are
using 'app' as local variable in new_window which might lead to garbage
collecting the App-instance at an inapropriate situation, the packs() will
not work well when resizing the window, why do you separate initialization
from 'create'?, .......
More information about the Python-list
mailing list