[wxPython] Sizers in widgets

From: Erwan Loisant [mailto:erwan@loisant.org]
Sent: Thursday, August 22, 2002 10:02 AM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython] Sizers in widgets

Hello.

Hi!

I want to make a custom widget being aggregation of several
base widgets. However, sizers don't seem to work in a widget.

Hmm.. When I make aggregate widgets, I usually derive a class from wxPanel
and stick things on my panel. The sizers work fine in this instance.

Is it only possible to put sizers in a wxFrame or derivated
? How can I define my own widget with sizers ?

You can set sizers on ANY wxWindow derived class. I dunno if this makes
sense for some controls, but you can do it...

jaime

···

-----Original Message-----

I'm new to python, so I don't know how well written the code is python-wise,
but I made a custom spinner widget to handle stepped and non-integer values
by using sizers, a wxTextCtrl and two wxButton's. If this is the type of
thing you are trying to do, you can see the SpinParam class in the source
code at:

.py?rev=1.2&content-type=text/vnd.viewcvs-markup

Another example is the SliderParam class that combines a wxStaticText,
exSlider and wxTextCtrl using sizers. BTW, I wrote this class because when I
created a wxSlider with the the wx_SL_LABELS style, the labels appeared
outside the sizer boundaries on win2k.

Also, I'm new to wxPython, and wanted to extend my gratitude to the people
who have made wxPython.

John

···

-----Original Message-----
From: wxpython-users-admin@lists.wxwindows.org
[mailto:wxpython-users-admin@lists.wxwindows.org]On Behalf Of Wyant,
Jaime
Sent: Thursday, August 22, 2002 6:21 AM
To: 'wxpython-users@lists.wxwindows.org'
Subject: RE: [wxPython] Sizers in widgets

>>>-----Original Message-----
>>>From: Erwan Loisant [mailto:erwan@loisant.org]
>>>Sent: Thursday, August 22, 2002 10:02 AM
>>>To: wxpython-users@lists.wxwindows.org
>>>Subject: [wxPython] Sizers in widgets
>>>
>>>
>>>Hello.
>>>
Hi!

>>>I want to make a custom widget being aggregation of several
>>>base widgets. However, sizers don't seem to work in a widget.
>>>

Hmm.. When I make aggregate widgets, I usually derive a class from wxPanel
and stick things on my panel. The sizers work fine in this instance.

>>>Is it only possible to put sizers in a wxFrame or derivated
>>>? How can I define my own widget with sizers ?
>>>

You can set sizers on ANY wxWindow derived class. I dunno if this makes
sense for some controls, but you can do it...

jaime

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

On second thought, my example probably isn't a solution, because I used
sizers exclusively for positioning all widgets, so my combination widgets go
inside sizers that go inside other sizers, eventually up to a
wxScrolledWindow. So Jaime's solution of putting the widget in a wxPanel is
probably better.

···

-----Original Message-----
From: wxpython-users-admin@lists.wxwindows.org
[mailto:wxpython-users-admin@lists.wxwindows.org]On Behalf Of John Bair
Sent: Thursday, August 22, 2002 10:07 AM
To: wxpython-users@lists.wxwindows.org
Subject: RE: [wxPython] Sizers in widgets

I'm new to python, so I don't know how well written the code is
python-wise,
but I made a custom spinner widget to handle stepped and
non-integer values
by using sizers, a wxTextCtrl and two wxButton's. If this is the type of
thing you are trying to do, you can see the SpinParam class in the source
code at: