Help for Toplevel

Muddy Coder cosmo_general at yahoo.com
Wed Apr 1 20:55:52 EDT 2009


Hi Folks,

I have a problem of handling Toplevel window. Basically, I wrote a
listbox viewer with scrollbars, and saved in file listbo.py. Then in
my main GUI window, with menu, I need to launch the listbox viewer, in
a new window. Obviously, a Toplevel window is needed. But, I failed at
passing parameters over to Toplevel window. Please take a look at my
code:

Listbox viewer:
class ScrolledList(Frame):
	def __init__(self, options, parent=None):
		Frame.__init__(self, parent)
		self.pack(expand=YES, fill=BOTH)
		self.makeWidgets(options)

In my main GUI:
from XXX import ScrolledList
class Foo:
     def __init__(self):
     ........
     def call_listbox(self, params):
           new = Toplevel()
           alist = ['foor','bar']
           ScrolledList(new,alist)

With the code above, the widgets did not show on the Toplevel window,
and the data list ['foo','bar'] did not show up either. Can somebody
help me on it? Thanks a lot!

Muddy Coder



More information about the Python-list mailing list