[Tutor] Tkinter
Shi Mu
samrobertsmith at gmail.com
Sat Oct 29 09:55:14 CEST 2005
move the bottom codes to the top and try to make
the codes following if __name__ == '__main__':
as few as possible.
also,
i want the main menu come first, and after clicking test/just try, i
can go to the "how are you" interface.
On 10/29/05, Liam Clarke <ml.cyresse at gmail.com> wrote:
> What kind of improvement you looking for?
>
> On 10/29/05, Shi Mu <samrobertsmith at gmail.com> wrote:
> > 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()
> > _______________________________________________
> > Tutor maillist - Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list