[Tutor] application with tabs

Luke Paireepinart rabidpoobear at gmail.com
Fri May 14 22:18:13 CEST 2010


On Fri, May 14, 2010 at 12:55 PM, Gary Koskenmaki <garywk at cableone.net> wrote:
> Hi,
>
> I'm new to any kind of application development, but have done some
> python scripting.
>
> What I'm doing is creating an application for a non-profit social
> services organization that will allow them to track the services they
> give their clients.
>
> 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 have never used this tabbing before, but I'm guessing that you have
to catch the tab switching event and manually set the active panel
that the tab widget is displaying.
Something like (pseudocode)

panel1 = MyPanel()
panel2 = MyPanel2()
tabber = WxNotebook()

def myfunc(event):
    if event.name == 'tab1':
        tabber.set_active(panel1)
    else:
        tabber.set_active(panel2)

tabber.register_callback('tabswitch', myfunc)

That's purely a guess though.

>
> Am I going about creating this application interface in the most
> difficult way?  Is there a better/easier way to create multiple
> application views in the same window?  Can anyone recommend good books,
> tutorials, etc...?
>

Personally I like Qt more than WxWindows.  In fact I like TK more as
well, but tkinter looks kinda crappy and non-native on almost every
platform.
There are lots of resources for Qt, and for pyQt specifically.

This is probably not the right place to ask this question though,
we're more for general Python questions.  May be better to ask on a
wxpython list.

HTH,
-Luke


More information about the Tutor mailing list