AW: [wxPython] resizing of window

take a look at the demos and sample code of wxLayoutConstraints - maybe
it helps you.
ciao
-----Ursprungliche Nachricht-----

···

Von: Guenther Fischer [SMTP:guenther.fischer@hrz.tu-chemnitz.de]
Gesendet am: Dienstag, 17. Juli 2001 13:38
An: wxpython-users@lists.wxwindows.org
Betreff: [wxPython] resizing of window

Hi,
I'm a newbe to wxPyton and python too - I'll rewrite a application written
in TCL/TK with python and wxpython.

I use the notebook, SpliiterWindow etc. - works well, but I'm wondering
to have to define the TK-entries here wxTextCtrl() on an absolute position
and a fix length.
I have constructs like:
        panel1 = wxPanel(self.nb, -1)
        self.nb.AddPage(panel1, "Wein")

        wxStaticText(panel1, -1, "Id:", wxPoint(5, 5), wxSize(15, 20))
        t = wxTextCtrl(panel1, 10, "", wxPoint(20, 5), wxSize(30, 20))
        wxStaticText(panel1, -1, "Name:", wxPoint(55,5), wxSize(35, 20))
        t2 = wxTextCtrl(panel1, 10, "", wxPoint(92, 5), wxSize(590, 20),
                       wxMAXIMIZE_BOX)
        wxStaticText(panel1, -1, "Jahrg.:", wxPoint(690,5), wxSize(35,
20))
        self.text = wxTextCtrl(panel1, -1, "2000", wxPoint(730, 5),
wxSize(40, 20))

What I miss is the relativ packing to another object and such as
expand=yes.
I want to habe the Id:-entry at the left side, the an expandable
Name:-entry and than the Jahrg.:-entry on the right side. And if the
user resizes the Window - this line will enlage or shorten in this manner.

Any tips/examles? Have I to use the wxBoxSizer?
--
  ~Guenther Fischer

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Heinl Raimund wrote:

take a look at the demos and sample code of wxLayoutConstraints - maybe
it helps you.

contraints are one option, but I think they are depricated, and sizers
are a more powerful and flexible option anyway. Take a look at the demo
for sizers, it will give you a pretty good idea what can be done, but it
can be a bit tricky to figure out how to actually do it, as the code is
pretty short on comments (at least it was when I last looked at it). You
should also study the wxWindows docs, and look at the Wiki at:

http://wxpython.org/cgi-bin/wiki/Getting_20Started#line471

between all these, you should be able to figure it out. It takes a
little while to wrap your brainb around sizers, but one you do, they are
a really nice way to handle layout, particularly if you are writing for
multiple platforms or languages.

I started to write a tutorial on sizers, with tk users in mind, but I'm
afraid I didn't get very far...sorry.

-Chris

···

--
Christopher Barker,
Ph.D.
ChrisHBarker@home.net --- --- ---
http://members.home.net/barkerlohmann ---@@ -----@@ -----@@
                                   ------@@@ ------@@@ ------@@@
Oil Spill Modeling ------ @ ------ @ ------ @
Water Resources Engineering ------- --------- --------
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------