[wxPython-users] Newbie needs some advice on sizers
Phil Mayes
phil at philmayes.com
Sat Oct 27 18:56:41 PDT 2007
At 07:38 PM 10/27/2007, you wrote:
>I want to create a panel with a bunch of yes/no questions on it that the
>user is
>to answer. I understand how to create these with the StaticText and ComboBox
>widgets, so I don't think that I need help with that. On this panel, I only
>want one question to appear at a time. Therefore, when the panel is first
>accessed in the GUI, I want only one yes/no question to appear. The user will
>choose their answer to this question, and another question will appear
>below the
>previous one that is dependent upon their answer (i.e. a different StaticText
>widget will appear depending on whether the user chooses yes or no on the
>previous question).
>
>How is this done? If I want to control the layout of these widgets with
>sizers,
>I have to create each widget before calling "SetSizer(object)" to attach the
>sizer to the panel. But if I do that, they all appear at once on the
>panel (not
>what I want).
>
>Also, what if I want the user to be able to change their mind. Let's say they
>want to change their answer to a question. I would want the yes/no questions
>that were presented to them after that specific change to disappear and be
>replaced with the pertinent yes/no question.
>
>Am I going about this the wrong way, or is there a very simple solution to
>this
>that a newbie like me hasn't figured out yes.
You can Hide() or Show() the individual windows. (Sizers also have Show()
and Hide() functions.) You may need to call Layout() as you show/hide
individual controls.
Phil
More information about the wxpython-users
mailing list