Hello. Here’s the scoop: I’m creating an address book which contains two classes. the first class is the Main class and creates the ‘main screen’. The second class is the Input class (derived from wxDialog) and creates a screen for user input.
In the first class, I have a menu item which calls a function Add(). Within Add() I then try to create an instance of my second class- passing it the arguments for ID and ‘title’.
In the Input class, I am simply subclassing wxDialog and overriding its init.
Error I keep getting is that the init of wxDialog in my second class requires an int. (I’ve tried passing it number values from the Add() function, assigning default values, etc.).
I’m not sure what I’m doing wrong, but it’s probably more of a misunderstanding of argument passing in Python on my part than a wx problem.
Pseudocode:
class Main(wxFrame): …
def Add( self, event):
additem = Input( int, 'title') #### I've also tried (self, int, "title") but I keep getting error of passing more arguments than expected to class
Error I keep getting is that the __init__ of wxDialog in my
second class requires an int. (I've tried passing it number
values from the Add() function, assigning default values, etc.).
class Input(wxDialog):
def __init__(self, ID, title):
wxDialog.__init__(self, ID, title...)
The documentation should say that the constructor requires the “parent” and “ID” fields–values of -1 for the latter and ether None or the main frame should do…
After a hundred years / Nobody knows the place,–
Agony, that enacted there, / Motionless as peace.
Weeds triumphant ranged, / Strangers strolled and spelled
At the lone orthography / Of the elder dead.
Winds of summer fields / Recollect the way,–
Instinct picking up the key / Dropped by memory.
- Emily Dickinson
Hello. Here’s the scoop: I’m creating an address book which contains two classes. the first class is the Main class and creates the ‘main screen’. The second class is the Input class (derived from wxDialog) and creates a screen for user input.
In the first class, I have a menu item which calls a function Add(). Within Add() I then try to create an instance of my second class- passing it the arguments for ID and ‘title’.
In the Input class, I am simply subclassing wxDialog and overriding its init.
Error I keep getting is that the init of wxDialog in my second class requires an int. (I’ve tried passing it number values from the Add() function, assigning default values, etc.).
I’m not sure what I’m doing wrong, but it’s probably more of a misunderstanding of argument passing in Python on my part than a wx problem.
Pseudocode:
class Main(wxFrame): …
def Add( self, event):
additem = Input( int, 'title') #### I've also tried (self, int, "title") but I keep getting error of passing more arguments than expected to class
class Input(wxDialog):
def __init__(self, ID, title):
wxDialog.__init__(self, ID, title...)
any help GREATLY appreciated, but please be specific as I’m quite thick headed.