[Tutor] application with tabs

Hugo Arts hugo.yoshi at gmail.com
Fri May 14 23:51:25 CEST 2010


On Fri, May 14, 2010 at 7:55 PM, Gary Koskenmaki <garywk at cableone.net> wrote:
> Hi,
>
>
> My plan so far was to use tabs for the different functions of the
> application such as entering data into the database, viewing data, and
> running reports.  I'm running into problems combining tabs with multiple
> data fields and buttons.  I can create multiple fields(text boxes) with
> wxFrame and wxPanel, but when using wxNotebook to create tabs only the
> last text box in each tab shows up.  Say I have 3 text boxes, only the
> third one shows up.  If I comment it out the second one shows up.  I
> have a very similar problem with buttons.
>

I don't know how exactly you're doing it, but in general you'd create
a wxPanel for each tab, place all your controls on it, and then use
the notebook.addPage call to add the panel.

> I have read and experimented with the examples on wxpywiki with no joy.
> Using the following example from wxpywiki the text boxes created in the
> TabPanel class are shown on every tab.  When moving the text box
> creation to the NotebookDemo class, so that I can have different
> types/numbers of text boxes on each tab, I run into the problem of
> having more than one text field displayed in each tab.
>

Right, that example pretty uses the approach I describe. The example
does have three different tabs, they just all look the same because
they are created from the same class. Please show us what exactly the
code you're using that leads to the problem you describe. I suspect
this is where things go wrong.

Hugo


More information about the Tutor mailing list