[WX] wxRadioBox and change choice

Michele Petrazzo michele.petrazzo at TOGLIunipex.it
Tue Sep 14 13:56:55 CEST 2004


Peter Hansen wrote:
> Michele Petrazzo wrote:
> 
>> I create a widget like this:
>> self.rb_method = wxRadioBox(choices=['choice1', 'choice2'], id=-1,
>>  label='Method', name='rb_method', parent=self, point=wxPoint(8, 320),
>>  size=wxSize(168, 72), style=wxRA_SPECIFY_COLS,)
>>
>> I want to change choice (the choice' labels) in runtime use, so in my 
>> code, choice1 -> test1, choice2 -> test2
>> The wxRadioBox have Setlabel method, but it only change the "title", 
>> not the choices.
>> Is it possible to do it? Or I must destroy and recreate the widget?
> 
> 
> The documentation (specifically the wxWindows reference) says this
> under SetLabel, which in C/C++ is overloaded to allow this:
> 
> wxPython note: In place of a single overloaded method name, wxPython 
> implements the following methods:
> 
>  SetLabel(string)  Sets the radiobox label.
>  SetItemLabel(n, string)  Sets a label for a radio button.
I read the documentation of RadioBox about 10-15 times, but I don't see 
this option. I need a coffee. :)

Thanks,
Michele



More information about the Python-list mailing list