Help for Toplevel

M

Muddy Coder

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
 
G

Gabriel Genellina

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)

shouldn't the last line be ScrolledList(alist,new)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top