wxPython and wxFlexGridSizer problem

Jeff Shannon jeff at ccvcorp.com
Mon Mar 25 19:17:38 EST 2002


Uwe Schmitt wrote:

> [ This is a repost of the following article:                               ]
> [ From: Uwe Schmitt <uwe at rocksport.de>                                     ]
> [ Subject: wxPython and wxFlexGridSizer problem                            ]
> [ Newsgroups: comp.soft-sys.wxwindows                                      ]
> [ Message-ID: <a7l70a$7s5pq$3 at hades.rz.uni-sb.de>                          ]
>
> Hi,
>
> when I try the following function on a linux machine I get an input
> mask consisting of a label and an input field. If i run it under
> Windows 2k, the label does not appear, and the inputfield is rendered
> into the first field of the grid...
>
> Here is the procedure:
>
>    def testtt(window):
>
>         basicSizer = wxBoxSizer(wxVERTICAL)
>
>         gridSizer= wxFlexGridSizer(cols=2)
>
>         t=wxStaticText(window, -1, "Eingabe:")
>         gridSizer.Add(t, wxALL | wxALIGN_RIGHT)
>         tt=wxTextCtrl(window, -1, "", size=wxSize(100,-1))
>         gridSizer.Add(tt, wxALL |wxALIGN_LEFT)
>
>         gridSizer.SetSizeHints(window)
>         gridSizer.Fit(window)
>         window.SetSizer(gridSizer)
>         window.SetAutoLayout(true)
>
>         window.ShowModal()

Are you sure that you want to use ShowModal()??  How are you setting up your
window?

This function looks okay to me, as far as it goes, but it's hard to say what
might be going on if we don't know where window is coming from.  I presume that
it's a wxDialog of some sort?  If so, why aren't you subclassing wxDialog and
putting this code in your __init__(), then calling ShowModal() from the function
that creates the dialog?

(You might also have better luck getting answers for this, if you ask on the
wxpython-users mailing list -- see wxpython.org to subscribe.)

Jeff Shannon
Technician/Programmer
Credit International





More information about the Python-list mailing list