I would like to implement the following (I think it is a truly common pattern):
I have got a radiobox with some options. When I choose one of them, another panel, holding another radiobox, has to change, showing different options (depending by the choose of the first radiobox).
Any suggests to implement this? I’m a newbie in desktop application and wxWidgets/wxPython is the first framework I use.
I would like to implement the following (I think it is a truly common pattern):
I have got a radiobox with some options. When I choose one of them, another panel, holding another radiobox, has to change, showing different options (depending by the choose of the first radiobox).
Any suggests to implement this? I'm a newbie in desktop application and wxWidgets/wxPython is the first framework I use.
Thanks in advance!
I'm sure there are several good ways to do this. Here's a couple I came up with off the top of my head...
When you click a radio button, just create the widgets, put them in a sizer and call something like self.Layout() or self.Refresh() to make the new stuff show up correctly. Alternatively, you could create the various panels that you plan to use (if there's not a lot of them) and just Hide() the current one and Show() the new one. The latter is probably easier to understand...
Basically what you can do is bind an event from the radiobuttons
to an event handler function so that when the user selects one of
the radiobuttons, that function is called. In that event handler
function you can then have code that will change the other panel
in the way you want. I'm not sure what changes you want, but
you can .Hide() or .Show() widgets, or change the values in a
wx.Choice or wx.ComboBox, or really anything.
(This is the wxWidgets documents, and so it is written with
the C++ syntax; unfortunately it seems the wxPython online
docs don't mention the event handler)
On Wed, May 13, 2009 at 6:43 AM, Domenico Nappo <domenico.nappo@gmail.com> wrote:
Hi there,
I would like to implement the following (I think it is a truly common
pattern):
I have got a radiobox with some options. When I choose one of them, another
panel, holding another radiobox, has to change, showing different options
(depending by the choose of the first radiobox).
Any suggests to implement this? I'm a newbie in desktop application and
wxWidgets/wxPython is the first framework I use.