Passing variables between two WxPython windows
So im writing a program and i need to get a list from the main GUI window
to the pop up window that does an action with the selected options from
the main window
the problem is i cant pass a variable when i call the class for the new
window
When i create the instance i want to pass the list
act = Action(None, "Action")
but it only lets me pass the name of the window and if i try to create a
new parameter i get this error:
Traceback (most recent call last):
File "C:\Documents and Settings\User\Desktop\Invent Manager.py", line
274, in auction
act = Action(None, "Action", "item")
File "C:\Documents and Settings\User\Desktop\Invent Manager.py", line
352, in __init__
self.InitUI()
File "C:\Documents and Settings\User\Desktop\Invent Manager.py", line
357, in InitUI
main = GUI()
TypeError: __init__() takes exactly 4 arguments (1 given)
here is my init of my pop up window:
def __init__(self, parent, title, item_id):
super(Action, self).__init__(parent, title=title,
size=(200, 200))
self.InitUI()
self.Centre()
self.Show()
someone please tell me how i can do this!
No comments:
Post a Comment