473,414 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

[WX] wxRadioBox and change choice

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?

Thanks,
Michele Petrazzo
Jul 18 '05 #1
2 2524
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.

-Peter
Jul 18 '05 #2
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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Logan | last post by:
Would you recommend to use the wx package of wxPython? From the documentation: Provides a way to drop the wx prefix from wxPython objects by dynamically loading and renaming objects from the...
9
by: monkey | last post by:
I just learn to make a blank windows frame with python and wxpython. I found the statment "import wx" cannot work as the original "from wxPython.wx import *". I see in the readme file of wxpython...
0
by: carlosperezs | last post by:
I have problems with this method. I have programmed this wx.Listctrl: self.ListCtrlMarks = wx.ListCtrl(self.panel, -1, style = wx.LC_REPORT) ...
2
by: eric dexter | last post by:
I am trying to steal this code from the wxpython demo but it appears that mb comes from nowhere and I am having errors because of it import wx ...
0
bartonc
by: bartonc | last post by:
#Boa:Dialog:DBConnectDialog import wx ##"""Given a set if login specs, create a dbServer instance and ## ensure that there is a valid, open connection to the database. ## If not, set the...
1
Elias Alhanatis
by: Elias Alhanatis | last post by:
Dear friends, First of all , i wish a Happy New Year to all of you!!!! I have been learning Python and the Tkinter GUI package for the last 6 months , and now i am trying to rewrite a program...
3
by: lee.walczak | last post by:
Hi, I have just started writing a GUI using wxpython after finding a limitation using Tkinter. I have read most tutorials on wxpython and slowly becoming accustomed considering I started with...
1
by: Fredrik Lundh | last post by:
Desmond Scott E wrote: wx is wxPython: http://www.wxpython.org/ </F>
0
by: sarabhjeet | last post by:
Hello all, I want to create a menu without using wx.Menu,shall i do this task using wx.Button.Actually wx.Menu uses the windows style so we can't change the font,font size and background etc of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.