Specific request with code example (encapsulation) __init__ problems
justin__devine at hotmail.com
Thu Aug 26 18:28:32 CEST 2004
Thanks I finally got it working. Big help. What's the difference
between SetLabel and SetItemLabel. Below is a paste form the wx manual
and it didn't contain that function, that's why was confused. It now
works but maybe you can help me understand this better. Is
SetItemLabel a generic function of wxControl or wxObject. Thanks again
void SetLabel(const wxString& label)
Sets the radiobox label.
void SetLabel(int n, const wxString& label)
Sets a label for a radio button.
label - The label to set.
n - The zero-based button index.
Richie Hindle wrote:
> > 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
> your posted example. I don't know why your code doesn't work - you
> be doing the right thing, and if I modify your Gobblewx_7public_.py
> your posted example then it all works.
> Here's what I did: I downloaded Gobblewx_7public_.py (a couple of
> 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
> form and hit "Download files", the label changes.
> Note that it's SetItemLabel, not SetLabel, which implies that you
> called your changelabel function, or you didn't look at the resulting
> Richie Hindle
> richie at entrian.com
More information about the Python-list