468,303 Members | 1,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,303 developers. It's quick & easy.

Tk

When I run the following code,
script kept running and I have to force it to stop.
Could you check the code to give suggestions how to improve it?
Thanks a lot!

from Tkinter import *
from Tkinter import _cnfmerge

class Dialog(Widget):
def __init__(self, master=None, cnf={}, **kw):
cnf = _cnfmerge((cnf, kw))
self.widgetName = '__dialog__'
Widget._setup(self, master, cnf)
self.num = self.tk.getint(
apply(self.tk.call,
('tk_dialog', self._w,
cnf['title'], cnf['text'],
cnf['bitmap'], cnf['default'])
+ cnf['strings']))
try: Widget.destroy(self)
except TclError: pass
def destroy(self): pass

if __name__ == '__main__':

q = Button(None, {'text': 'How are you',
Pack: {}})
b1 = Listbox()
b1.pack()

c1 = Checkbutton(text="Check")
c1.pack()

q.mainloop()

from Tkinter import *
root =Tk()
menu=Menu(root)
root.config(menu=menu)
filemenu=Menu(menu)
menu.add_cascade(label="Test", menu=filemenu)
filemenu.add_command(label="Just Try")
filemenu.add_separator()
mainloop()
Oct 28 '05 #1
0 1082

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.