Specific request with code example (encapsulation) __init__ problems

Justin justin__devine at hotmail.com
Thu Aug 26 12:28:32 EDT 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

wxRadioBox::wxRadioBox
wxRadioBox::~wxRadioBox
wxRadioBox::Create
wxRadioBox::Enable
wxRadioBox::FindString
wxRadioBox::GetCount
wxRadioBox::GetLabel
wxRadioBox::GetSelection
wxRadioBox::GetStringSelection
wxRadioBox::GetString
wxRadioBox::Number
wxRadioBox::SetLabel
wxRadioBox::SetSelection
wxRadioBox::SetStringSelection
wxRadioBox::Show


wxRadioBox::SetLabel
void SetLabel(const wxString& label)

Sets the radiobox label.

void SetLabel(int n, const wxString& label)

Sets a label for a radio button.

Parameters

label - The label to set.
n - The zero-based button index.




Richie Hindle wrote:
> [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