Specific request with code example (encapsulation) __init__ problems

Richie Hindle richie at entrian.com
Thu Aug 26 11:14:43 EDT 2004


[Justin]
> my problem is now it appears that my widgets are completely
> encapsulated within this __init__ class and I cannot get at them.

That's not true if you say "self.x = y", as you have done with self.rb in
your posted example.  I don't know why your code doesn't work - you seem to
be doing the right thing, and if I modify your Gobblewx_7public_.py to match
your posted example then it all works.

Here's what I did: I downloaded Gobblewx_7public_.py (a couple of days ago,
when you first mentioned it) changed 'rb' to 'self.rb' throughout the
Gmainpanel.__init__ function (lines 484-493), and added the line:

            self.rb.SetItemLabel(1, "test change")

as the first line of the yousuredlg function (line 571).  When I fill in the
form and hit "Download files", the label changes.

Note that it's SetItemLabel, not SetLabel, which implies that you never
called your changelabel function, or you didn't look at the resulting
traceback...

-- 
Richie Hindle
richie at entrian.com




More information about the Python-list mailing list