Re: [Tutor] passing arguments via an instance of a class

2007-04-04 Thread Alan Gauld
"Che M" <[EMAIL PROTECTED]> wrote > > >def OnButton1Button(self, event): > > >self.weightplot = > > > PlotPanel(self.notebook1,xpoints,ypoints) > > > >But this needs to use self to access the member values: > > Doing it this way didn't work--it gave the error: > because, I think, self in

Re: [Tutor] passing arguments via an instance of a class

2007-04-04 Thread Che M
John Fouhy said: Can you post the full error message (including stack trace and line numbers) and the code for the last function in the stack trace? (i.e. the code where the NameError occurs) It is now working (so I won't post the code/errors unless you think it is useful for people to see),

Re: [Tutor] passing arguments via an instance of a class

2007-04-04 Thread Kent Johnson
Alan Gauld wrote: > "Kent Johnson" <[EMAIL PROTECTED]> wrote > #these are the points I want to be plotted when I push this button xpoints=[2,4,6] ypoints=[10,20,30] self.weightplot = PlotPanel(self.notebook1,xpoints,ypoints) >>> But this needs to use self t

Re: [Tutor] passing arguments via an instance of a class

2007-04-04 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote >>> #these are the points I want to be plotted when I push this button >>>xpoints=[2,4,6] >>>ypoints=[10,20,30] >>>self.weightplot = PlotPanel(self.notebook1,xpoints,ypoints) >> >> But this needs to use self to access the member val

Re: [Tutor] passing arguments via an instance of a class

2007-04-04 Thread Kent Johnson
Alan Gauld wrote: > #This is now the button which is supposed to feed the PlotPanel > #the points it needs. It is a method of the wxFrame (code not shown) >> def OnButton1Button(self, event): >> #these are the points I want to be plotted when I push this button >>xpoints=[2,4,6] >>

Re: [Tutor] passing arguments via an instance of a class

2007-04-04 Thread Alan Gauld
"Che M" <[EMAIL PROTECTED]> wrote > My problem is I don't understand how to create > the class such that it a) expects to be passed two lists, You've done that correctly by creating an init that takes xpoints and ypoints and storing those as members of self. > b) hands those lists off to its dr

Re: [Tutor] passing arguments via an instance of a class

2007-04-03 Thread John Fouhy
On 04/04/07, Che M <[EMAIL PROTECTED]> wrote: > As is, when I press that button I get this error: > > Name Error: global name xpoints is not defined. Can you post the full error message (including stack trace and line numbers) and the code for the last function in the stack trace? (i.e. the code