473,386 Members | 1,785 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,386 software developers and data experts.

Issue with Tkinter Dialog

440 256MB
Hi,

I have created a Simple Dialog with ComboBox and Radio buttons.When I execute my UI source code.I am able to see the dialog .When I Close the Dialog,I am not able to edit the source code for the dialog.I have to go to the task manager and kill the PythonWin.exe and restart the PythonWin and work on the UI modifications.

Whether anybody has faced the similar problem,If so ,your help will be really appreciated

Thanks
PSB
Apr 20 '07 #1
12 2005
bartonc
6,596 Expert 4TB
Hi,

I have created a Simple Dialog with ComboBox and Radio buttons.When I execute my UI source code.I am able to see the dialog .When I Close the Dialog,I am not able to edit the source code for the dialog.I have to go to the task manager and kill the PythonWin.exe and restart the PythonWin and work on the UI modifications.

Whether anybody has faced the similar problem,If so ,your help will be really appreciated

Thanks
PSB
You must
Expand|Select|Wrap|Line Numbers
  1. myDialog.destroy()
dialogs when you are done with them.

Forum stuff:
You need to put "Tkinter" into your post titles. For example, in wxPython, it's
Expand|Select|Wrap|Line Numbers
  1. myDialog.Destroy()
so please help us help others. Thanks.
Apr 20 '07 #2
psbasha
440 256MB
Thanks Barton for the suggestion

-PSB
Apr 20 '07 #3
psbasha
440 256MB
Hi,

First time when I execute the UI source code ,I am able to see the Dialog.When I close the dialog,and execute the Source code without closing the PythonWin IDE,I am not able to see the Dialog.To see that I have to close the application thru Task Manager by killing the "PythonWin.exe"


Thanks
PSB
Apr 20 '07 #4
bartonc
6,596 Expert 4TB
Hi,

First time when I execute the UI source code ,I am able to see the Dialog.When I close the dialog,and execute the Source code without closing the PythonWin IDE,I am not able to see the Dialog.To see that I have to close the application thru Task Manager by killing the "PythonWin.exe"


Thanks
PSB
If you have destroy()ed the dialog and you are still having the problem, it may be because your tools don't work very well. The IDE should spawn a thread (new python instance in task manager) and run your program there, thereby having much greater control over the software under development.
Apr 20 '07 #5
psbasha
440 256MB
In Tkinter -

What is the callback/handler function to be called for the "window closing", i.e "X" symbol shown at the right top location of the dialog.

-PSB
Apr 20 '07 #6
bartonc
6,596 Expert 4TB
In Tkinter -

What is the callback/handler function to be called for the "window closing", i.e "X" symbol shown at the right top location of the dialog.

-PSB
wm portocol may be the thing you are after. Here is a snippet from a very complex window that I wrote a long time ago, but it works well:
Expand|Select|Wrap|Line Numbers
  1. class Debugger:
  2.     """Dialog Window for BCD11IDE's debugger.
  3.  
  4.     """
  5.     def __init__(self, root, menu=None, flist=None, srecord=''):
  6.         self.root = root
  7.         self.top = top = ListedToplevel(root, menu=menu)
  8.         self.flist = flist
  9.  
  10.         top.option_add("*Entry*font", "Courier 10", 20)
  11.         top.configure(borderwidth=5)
  12.         top.geometry("+%d+%d" % (root.winfo_rootx()+75,
  13.                                   root.winfo_rooty()+100))
  14.         if menu is None:
  15.             root.withdraw()     # Here, we are running from __main__
  16.         self.bg = "SystemButtonFace"
  17. ##        self.bg = "white"
  18.         self.baudrate = baudrate = 9600     # Needed by baudrate value widget
  19.         self.quetime = quetime = 20.0/baudrate + .010
  20.  
  21.         self.CreateWidgets(top)                     # Fit widgets into self
  22.         top.resizable(height=FALSE, width=FALSE)    # then lock the size
  23.  
  24.         top.title('BCD11IDE Debugger')
  25.         top.protocol("WM_DELETE_WINDOW", self.close)
  26.         top.tkraise()
  27.         top.wm_deiconify()
  28.  
  29.         self.s19value.set(srecord)
  30.  
  31.         self.textView.focus_set()
  32.         top.focused_widget = self.textView
  33. # SNIP #
  34.  
  35.     def CreateWidgets(self, top):
  36.         self.gui_only = False
  37.         self.frameMain = frameMain = Frame(top, borderwidth=2, relief=SUNKEN)
  38.         frameMain.grid(row=0, column=0)
  39.         frameBg = Frame(frameMain)  # Make the background frame
  40. ##        frameBg = Frame(frameMain, bg=self.bg)  # Make the background frame
  41.         frameBg.pack(expand=TRUE, fill=BOTH)
  42.         # Put labels across row zero
  43.         Label(frameBg, text = 'Registers', bg=self.bg
  44.               ).grid(row=0, column=0, sticky=EW, columnspan=2, padx=5, pady=5)
  45.         Label(frameBg, text='Addr / Label', bg=self.bg
  46.               ).grid(row=0, column=2, sticky=W, columnspan=2, padx=5, pady=5)
  47.         Label(frameBg, text='Value', bg=self.bg
  48.               ).grid(row=0, column=4, sticky=W, columnspan=1, padx=5, pady=5)
  49.         Label(frameBg, text='Address', bg=self.bg
  50.               ).grid(row=0, column=5, sticky=W, columnspan=1, padx=5, pady=5)
  51.         Label(frameBg, text=' Machine  Code ', bg=self.bg
  52.               ).grid(row=0, column=6, sticky=W, columnspan=1, padx=5, pady=5)
  53.         Label(frameBg, text='Label  Name ', bg=self.bg
  54.               ).grid(row=0, column=7, sticky=W, columnspan=1, padx=5, pady=5)
  55.         Label(frameBg, text='Mnemonic and Operands', bg=self.bg
  56.               ).grid(row=0, column=8, sticky=EW, columnspan=2, padx=5, pady=5)
  57.         Label(frameBg, text='Command', bg=self.bg
  58.               ).grid(row=0, column=11, sticky=W, columnspan=1, padx=5, pady=5)
  59.  
  60.         # Fill in row 1
  61.         Label(frameBg, text='PC', bg=self.bg
  62.               ).grid(row=1, column=0, sticky=E, columnspan=1, padx=5)
  63.         pcvalue = StringVar(top)
  64.         pcentry = Entry(frameBg, textvariable=pcvalue, width=5)
  65.         pcentry.grid(row=1, column=1, sticky=W, columnspan=1, padx=5)
  66.         l1value = StringVar(top)
  67.         l1entry = Entry(frameBg, textvariable=l1value, width=12)
  68.         l1entry.grid(row=1, column=2, sticky=W, columnspan=2, padx=5)
  69.         m1value = StringVar(top)
  70.         m1entry = Entry(frameBg, textvariable=m1value, width=3)
  71.         m1entry.grid(row=1, column=4, sticky=W, columnspan=1, padx=5)
  72.  
  73.         frameDisAsm = Frame(frameBg)
  74.         frameDisAsm.grid(row=1, column=5, sticky=N+SW, rowspan=6, columnspan=6, padx=5)
  75.         self.disAsmList = Listbox(frameDisAsm, width=60, height=8, takefocus=FALSE,
  76.                                   font=('Courier', 8), exportselection=FALSE)
  77.         self.dalScroll = Scrollbar(frameDisAsm, command=self.disAsmList.yview)
  78.         self.disAsmList.config(yscrollcommand=self.dalScroll.set)
  79.         self.disAsmList.pack(side=LEFT, expand=TRUE, fill=BOTH)
  80.         self.dalScroll.pack(side=LEFT, fill=Y)
  81.         self.disAsmList.bind('<Double-Button-1>', self.AsmListDoubleClick)
  82.  
  83.         button = Button(frameBg, text='Call', command=self.Call, takefocus=0)
  84.         button.grid(row=1, column=11, sticky=N+EW, rowspan=2, columnspan=1, padx=5)
  85.  
  86.         # Fill in row 2
  87.         Label(frameBg, text='Y', bg=self.bg
  88.               ).grid(row=2, column=0, sticky=E, columnspan=1, padx=5)
  89.         yvalue = StringVar(top)
  90.         yentry = Entry(frameBg, textvariable=yvalue, width=5)
  91.         yentry.grid(row=2, column=1, sticky=W, columnspan=1, padx=5)
  92.         l2value = StringVar(top)
  93.         l2entry = Entry(frameBg, textvariable=l2value, width=12)
  94.         l2entry.grid(row=2, column=2, sticky=W, columnspan=2, padx=5)
  95.         m2value = StringVar(top)
  96.         m2entry = Entry(frameBg, textvariable=m2value, width=3)
  97.         m2entry.grid(row=2, column=4, sticky=W, columnspan=1, padx=5)
  98.  
  99.         # Fill in row 3
  100.         Label(frameBg, text='X', bg=self.bg
  101.               ).grid(row=3, column=0, sticky=E, columnspan=1, padx=5)
  102.         xvalue = StringVar(top)
  103.         xentry = Entry(frameBg, textvariable=xvalue, width=5)
  104.         xentry.grid(row=3, column=1, sticky=W, columnspan=1, padx=5)
  105.         l3value = StringVar(top)
  106.         l3entry = Entry(frameBg, textvariable=l3value, width=12)
  107.         l3entry.grid(row=3, column=2, sticky=W, columnspan=2, padx=5)
  108.         m3value = StringVar(top)
  109.         m3entry = Entry(frameBg, textvariable=m3value, width=3)
  110.         m3entry.grid(row=3, column=4, sticky=W, columnspan=1, padx=5)
  111.         button = Button(frameBg, text='Step', command=self.Step, takefocus=0)
  112.         button.grid(row=3, column=11, sticky=N+EW, rowspan=2, columnspan=1, padx=5)
  113.  
  114.         # Fill in row 4
  115.         Label(frameBg, text='A:B', bg=self.bg
  116.               ).grid(row=4, column=0, sticky=E, columnspan=1, padx=5)
  117.  
  118.         frameDEntry = Frame(frameBg, relief=SUNKEN, borderwidth=2)
  119.         frameDEntry.grid(row=4, column=1, sticky=W, rowspan=1, columnspan=1, padx=5)
  120.         avalue = StringVar(top)
  121.         aentry = Entry(frameDEntry, textvariable=avalue, width=2, relief=FLAT, borderwidth=0)
  122.         aentry.pack(side=LEFT)
  123.         Label(frameDEntry, text=':', bg = "white", padx=0, pady=0).pack(side=LEFT, fill=Y)
  124.         bvalue = StringVar(top)
  125.         bentry = Entry(frameDEntry, textvariable=bvalue, width=2, relief=FLAT, borderwidth=0)
  126.         bentry.pack(side=LEFT)
  127.  
  128.         l4value = StringVar(top)
  129.         l4entry = Entry(frameBg, textvariable=l4value, width=12)
  130.         l4entry.grid(row=4, column=2, sticky=W, columnspan=2, padx=5)
  131.         m4value = StringVar(top)
  132.         m4entry = Entry(frameBg, textvariable=m4value, width=5)
  133.         m4entry.grid(row=4, column=4, sticky=W, columnspan=1, padx=5)
  134.  
  135.         # Fill in row 5
  136.         Label(frameBg, text='CC', bg=self.bg
  137.               ).grid(row=5, column=0, sticky=E, columnspan=1, padx=5)
  138.         ccvalue = StringVar(top)
  139.         ccentry = Entry(frameBg, textvariable=ccvalue, width=3)
  140.         ccentry.grid(row=5, column=1, sticky=W, columnspan=1, padx=5)
  141.         l5value = StringVar(top)
  142.         self.l5entry = Entry(frameBg, textvariable=l5value, width=12)
  143.         self.l5entry.grid(row=5, column=2, sticky=W, columnspan=2, padx=5)
  144.         m5value = StringVar(top)
  145.         m5entry = Entry(frameBg, textvariable=m5value, width=5)
  146.         m5entry.grid(row=5, column=4, sticky=W, columnspan=1, padx=5)
  147.         button = Button(frameBg, text='Proceed', command=self.Proceed, takefocus=0)
  148.         button.grid(row=5, column=11, sticky=N+EW, rowspan=2, columnspan=1, padx=5)
  149.  
  150.         # Fill in row 6
  151.         Label(frameBg, text='SP', bg=self.bg
  152.               ).grid(row=6, column=0, sticky=E, columnspan=1, padx=5)
  153.         spvalue = StringVar(top)
  154.         spentry = Entry(frameBg, textvariable=spvalue, width=5)
  155.         spentry.grid(row=6, column=1, sticky=W, columnspan=1, padx=5)
  156.         l6value = StringVar(top)
  157.         l6entry = Entry(frameBg, textvariable=l6value, width=12)
  158.         l6entry.grid(row=6, column=2, sticky=W, columnspan=2, padx=5)
  159.         m6value = StringVar(top)
  160.         m6entry = Entry(frameBg, textvariable=m6value, width=5)
  161.         m6entry.grid(row=6, column=4, sticky=W, columnspan=1, padx=5)
  162.  
  163.         # Make lists of entry widgets for <Return> event handling
  164.         # Register entry lists
  165.         self.reglist = [pcentry, yentry, xentry, aentry,
  166.                          bentry, ccentry, spentry]
  167.  
  168.         for entry in self.reglist:
  169.             entry.bind('<Return>', self.ChangeReg) # Change any register
  170.             entry.bind('<FocusOut>', self.ChangeReg)
  171.             entry.bind('<FocusIn>', self.ReFocus)
  172. # SNIP #
  173.  
  174.     def close(self, event=None):
  175.         self.running = False
  176.         self.root.after_cancel(self.PCID)
  177.         self.tty.close()
  178.         if self.flist:
  179.             self.flist.debugger = None
  180.         self.queue = None
  181.         self.top.destroy()
Apr 20 '07 #7
bartonc
6,596 Expert 4TB
wm portocol may be the thing you are after. Here is a snippet from a very complex window that I wrote a long time ago, but it works well:
Expand|Select|Wrap|Line Numbers
  1. class Debugger:
  2.     """Dialog Window for BCD11IDE's debugger.
  3.  
  4.     """
  5.     def __init__(self, root, menu=None, flist=None, srecord=''):
  6.         self.root = root
  7.         self.top = top = ListedToplevel(root, menu=menu)
  8.         self.flist = flist
  9.  
  10.         top.option_add("*Entry*font", "Courier 10", 20)
  11.         top.configure(borderwidth=5)
  12.         top.geometry("+%d+%d" % (root.winfo_rootx()+75,
  13.                                   root.winfo_rooty()+100))
  14.         if menu is None:
  15.             root.withdraw()     # Here, we are running from __main__
  16.         self.bg = "SystemButtonFace"
  17. ##        self.bg = "white"
  18.         self.baudrate = baudrate = 9600     # Needed by baudrate value widget
  19.         self.quetime = quetime = 20.0/baudrate + .010
  20.  
  21.         self.CreateWidgets(top)                     # Fit widgets into self
  22.         top.resizable(height=FALSE, width=FALSE)    # then lock the size
  23.  
  24.         top.title('BCD11IDE Debugger')
  25.         top.protocol("WM_DELETE_WINDOW", self.close)
  26.         top.tkraise()
  27.         top.wm_deiconify()
  28.  
  29.         self.s19value.set(srecord)
  30.  
  31.         self.textView.focus_set()
  32.         top.focused_widget = self.textView
  33. # SNIP #
  34.  
  35.     def CreateWidgets(self, top):
  36.         self.gui_only = False
  37.         self.frameMain = frameMain = Frame(top, borderwidth=2, relief=SUNKEN)
  38.         frameMain.grid(row=0, column=0)
  39.         frameBg = Frame(frameMain)  # Make the background frame
  40. ##        frameBg = Frame(frameMain, bg=self.bg)  # Make the background frame
  41.         frameBg.pack(expand=TRUE, fill=BOTH)
  42.         # Put labels across row zero
  43.         Label(frameBg, text = 'Registers', bg=self.bg
  44.               ).grid(row=0, column=0, sticky=EW, columnspan=2, padx=5, pady=5)
  45.         Label(frameBg, text='Addr / Label', bg=self.bg
  46.               ).grid(row=0, column=2, sticky=W, columnspan=2, padx=5, pady=5)
  47.         Label(frameBg, text='Value', bg=self.bg
  48.               ).grid(row=0, column=4, sticky=W, columnspan=1, padx=5, pady=5)
  49.         Label(frameBg, text='Address', bg=self.bg
  50.               ).grid(row=0, column=5, sticky=W, columnspan=1, padx=5, pady=5)
  51.         Label(frameBg, text=' Machine  Code ', bg=self.bg
  52.               ).grid(row=0, column=6, sticky=W, columnspan=1, padx=5, pady=5)
  53.         Label(frameBg, text='Label  Name ', bg=self.bg
  54.               ).grid(row=0, column=7, sticky=W, columnspan=1, padx=5, pady=5)
  55.         Label(frameBg, text='Mnemonic and Operands', bg=self.bg
  56.               ).grid(row=0, column=8, sticky=EW, columnspan=2, padx=5, pady=5)
  57.         Label(frameBg, text='Command', bg=self.bg
  58.               ).grid(row=0, column=11, sticky=W, columnspan=1, padx=5, pady=5)
  59.  
  60.         # Fill in row 1
  61.         Label(frameBg, text='PC', bg=self.bg
  62.               ).grid(row=1, column=0, sticky=E, columnspan=1, padx=5)
  63.         pcvalue = StringVar(top)
  64.         pcentry = Entry(frameBg, textvariable=pcvalue, width=5)
  65.         pcentry.grid(row=1, column=1, sticky=W, columnspan=1, padx=5)
  66.         l1value = StringVar(top)
  67.         l1entry = Entry(frameBg, textvariable=l1value, width=12)
  68.         l1entry.grid(row=1, column=2, sticky=W, columnspan=2, padx=5)
  69.         m1value = StringVar(top)
  70.         m1entry = Entry(frameBg, textvariable=m1value, width=3)
  71.         m1entry.grid(row=1, column=4, sticky=W, columnspan=1, padx=5)
  72.  
  73.         frameDisAsm = Frame(frameBg)
  74.         frameDisAsm.grid(row=1, column=5, sticky=N+SW, rowspan=6, columnspan=6, padx=5)
  75.         self.disAsmList = Listbox(frameDisAsm, width=60, height=8, takefocus=FALSE,
  76.                                   font=('Courier', 8), exportselection=FALSE)
  77.         self.dalScroll = Scrollbar(frameDisAsm, command=self.disAsmList.yview)
  78.         self.disAsmList.config(yscrollcommand=self.dalScroll.set)
  79.         self.disAsmList.pack(side=LEFT, expand=TRUE, fill=BOTH)
  80.         self.dalScroll.pack(side=LEFT, fill=Y)
  81.         self.disAsmList.bind('<Double-Button-1>', self.AsmListDoubleClick)
  82.  
  83.         button = Button(frameBg, text='Call', command=self.Call, takefocus=0)
  84.         button.grid(row=1, column=11, sticky=N+EW, rowspan=2, columnspan=1, padx=5)
  85.  
  86.         # Fill in row 2
  87.         Label(frameBg, text='Y', bg=self.bg
  88.               ).grid(row=2, column=0, sticky=E, columnspan=1, padx=5)
  89.         yvalue = StringVar(top)
  90.         yentry = Entry(frameBg, textvariable=yvalue, width=5)
  91.         yentry.grid(row=2, column=1, sticky=W, columnspan=1, padx=5)
  92.         l2value = StringVar(top)
  93.         l2entry = Entry(frameBg, textvariable=l2value, width=12)
  94.         l2entry.grid(row=2, column=2, sticky=W, columnspan=2, padx=5)
  95.         m2value = StringVar(top)
  96.         m2entry = Entry(frameBg, textvariable=m2value, width=3)
  97.         m2entry.grid(row=2, column=4, sticky=W, columnspan=1, padx=5)
  98.  
  99.         # Fill in row 3
  100.         Label(frameBg, text='X', bg=self.bg
  101.               ).grid(row=3, column=0, sticky=E, columnspan=1, padx=5)
  102.         xvalue = StringVar(top)
  103.         xentry = Entry(frameBg, textvariable=xvalue, width=5)
  104.         xentry.grid(row=3, column=1, sticky=W, columnspan=1, padx=5)
  105.         l3value = StringVar(top)
  106.         l3entry = Entry(frameBg, textvariable=l3value, width=12)
  107.         l3entry.grid(row=3, column=2, sticky=W, columnspan=2, padx=5)
  108.         m3value = StringVar(top)
  109.         m3entry = Entry(frameBg, textvariable=m3value, width=3)
  110.         m3entry.grid(row=3, column=4, sticky=W, columnspan=1, padx=5)
  111.         button = Button(frameBg, text='Step', command=self.Step, takefocus=0)
  112.         button.grid(row=3, column=11, sticky=N+EW, rowspan=2, columnspan=1, padx=5)
  113.  
  114.         # Fill in row 4
  115.         Label(frameBg, text='A:B', bg=self.bg
  116.               ).grid(row=4, column=0, sticky=E, columnspan=1, padx=5)
  117.  
  118.         frameDEntry = Frame(frameBg, relief=SUNKEN, borderwidth=2)
  119.         frameDEntry.grid(row=4, column=1, sticky=W, rowspan=1, columnspan=1, padx=5)
  120.         avalue = StringVar(top)
  121.         aentry = Entry(frameDEntry, textvariable=avalue, width=2, relief=FLAT, borderwidth=0)
  122.         aentry.pack(side=LEFT)
  123.         Label(frameDEntry, text=':', bg = "white", padx=0, pady=0).pack(side=LEFT, fill=Y)
  124.         bvalue = StringVar(top)
  125.         bentry = Entry(frameDEntry, textvariable=bvalue, width=2, relief=FLAT, borderwidth=0)
  126.         bentry.pack(side=LEFT)
  127.  
  128.         l4value = StringVar(top)
  129.         l4entry = Entry(frameBg, textvariable=l4value, width=12)
  130.         l4entry.grid(row=4, column=2, sticky=W, columnspan=2, padx=5)
  131.         m4value = StringVar(top)
  132.         m4entry = Entry(frameBg, textvariable=m4value, width=5)
  133.         m4entry.grid(row=4, column=4, sticky=W, columnspan=1, padx=5)
  134.  
  135.         # Fill in row 5
  136.         Label(frameBg, text='CC', bg=self.bg
  137.               ).grid(row=5, column=0, sticky=E, columnspan=1, padx=5)
  138.         ccvalue = StringVar(top)
  139.         ccentry = Entry(frameBg, textvariable=ccvalue, width=3)
  140.         ccentry.grid(row=5, column=1, sticky=W, columnspan=1, padx=5)
  141.         l5value = StringVar(top)
  142.         self.l5entry = Entry(frameBg, textvariable=l5value, width=12)
  143.         self.l5entry.grid(row=5, column=2, sticky=W, columnspan=2, padx=5)
  144.         m5value = StringVar(top)
  145.         m5entry = Entry(frameBg, textvariable=m5value, width=5)
  146.         m5entry.grid(row=5, column=4, sticky=W, columnspan=1, padx=5)
  147.         button = Button(frameBg, text='Proceed', command=self.Proceed, takefocus=0)
  148.         button.grid(row=5, column=11, sticky=N+EW, rowspan=2, columnspan=1, padx=5)
  149.  
  150.         # Fill in row 6
  151.         Label(frameBg, text='SP', bg=self.bg
  152.               ).grid(row=6, column=0, sticky=E, columnspan=1, padx=5)
  153.         spvalue = StringVar(top)
  154.         spentry = Entry(frameBg, textvariable=spvalue, width=5)
  155.         spentry.grid(row=6, column=1, sticky=W, columnspan=1, padx=5)
  156.         l6value = StringVar(top)
  157.         l6entry = Entry(frameBg, textvariable=l6value, width=12)
  158.         l6entry.grid(row=6, column=2, sticky=W, columnspan=2, padx=5)
  159.         m6value = StringVar(top)
  160.         m6entry = Entry(frameBg, textvariable=m6value, width=5)
  161.         m6entry.grid(row=6, column=4, sticky=W, columnspan=1, padx=5)
  162.  
  163.         # Make lists of entry widgets for <Return> event handling
  164.         # Register entry lists
  165.         self.reglist = [pcentry, yentry, xentry, aentry,
  166.                          bentry, ccentry, spentry]
  167.  
  168.         for entry in self.reglist:
  169.             entry.bind('<Return>', self.ChangeReg) # Change any register
  170.             entry.bind('<FocusOut>', self.ChangeReg)
  171.             entry.bind('<FocusIn>', self.ReFocus)
  172. # SNIP #
  173.  
  174.     def close(self, event=None):
  175.         self.running = False
  176.         self.root.after_cancel(self.PCID)
  177.         self.tty.close()
  178.         if self.flist:
  179.             self.flist.debugger = None
  180.         self.queue = None
  181.         self.top.destroy()
The ListedToplevel(root, menu=menu) came for IDLE lib.
Apr 20 '07 #8
psbasha
440 256MB
I executed the above code.But I am not anble to see any dialog pop up.

what does the above code does?.

Thanks
PSB
Apr 20 '07 #9
psbasha
440 256MB
In Tkinter:

I hope the close event method/callback ,will solve the problem.Since I am using the close button,no method has been written to destroy the window.

Could anybody suggest the piece of code for closing the window.

-PSB
Apr 20 '07 #10
psbasha
440 256MB
While debugging the Dialog code,when we close the Dialog window the debug mode of the code has to come out.Even if I press Shift+F5,the debug mode is not stopped.I have to kill the PythonWin.exe

-PSB
Apr 21 '07 #11
bartonc
6,596 Expert 4TB
I executed the above code.But I am not anble to see any dialog pop up.

what does the above code does?.

Thanks
PSB
That's why it's called a "snippet": for example only.
Apr 21 '07 #12
bartonc
6,596 Expert 4TB
While debugging the Dialog code,when we close the Dialog window the debug mode of the code has to come out.Even if I press Shift+F5,the debug mode is not stopped.I have to kill the PythonWin.exe

-PSB
What I do is debug a dialog entirely on its own (just like a top level window), then call the WORKING dialog from the application. Like so:
create the dialog in a single module
at the bottom of the module add
Expand|Select|Wrap|Line Numbers
  1. if __name__ == "__main__":
  2.     root = Tk()
  3.     testDialog = TheDialogClassUnderTest(root)
  4.     testDialog.pack()
  5.     root.mainloop()
then you can import your working dialog into your application.
Apr 21 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Thomas Nücker | last post by:
Hi! I am creating a dialog-box within my application, using tkinter. The problem is the following: After the dialogbox is started, the main application window comes again to top and the...
3
by: DoubleM | last post by:
Hi, I'm running Python2.3.3c1 on Mandrake 9.1 The following code is designed to bring up a window with a button labeled "popup". Clicking on the popup buttons triggers a secondary window with...
2
by: Stewart Midwinter | last post by:
I would like to link the contents of three OptionMenu lists. When I select an item from the first list (call it continents), the contents of the 2nd list (call it countries) would update. And in...
0
by: Stewart Midwinter | last post by:
I've got a Tkinter app that draws three histograms. At this point I am simulating real data by drawing rectangles whose size is defined by random numbers; in the future there would be real data...
2
by: Irmen de Jong | last post by:
Hi, I'm having trouble with the code below. It's just a regular Tk text widget in which you can type and select text as expected, however the call to tkFileDialog.askopenfilename() seems to screw...
6
by: phil | last post by:
I posted the following yesterday and got no response and did some testing simplifying the circumstances and it appears that deepcopy fails when the object to be copied contains a reference to a...
1
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
3
by: dwelch91 | last post by:
I'm trying unsuccessfully to do something in Tk that I though would be easy. After Googling this all day, I think I need some help. I am admittedly very novice with Tk (I started with it...
5
by: msunderwd | last post by:
Having a problem with "compiling" a Tkinter/python program using py2exe (and pyinstaller, for that matter)... I have several dialogs that are derived from the tkSimpleDialog.Dialog class. These...
0
by: nicstel | last post by:
Hello. My script run fine within python but not in my program(SDS/2 wich is a software like Autocad). The problem is I got an error when the time comes to read the line14 to 19. (Source code come...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.