[wxPython] wxBoxSizer glitch

More oddities from the hands of incompetence here :slight_smile:

(Which reminds me, did anyone else manage to reproduce my
definitely-not-red OGL window? It was consistent on all
the Linux machines here at work (I didn't try windoze)
as well as my home Linux box)

Anyway, BoxSizers this time... when I create a BoxSizer,
then assign four items to it, why is it that the first one
behaves completely differently on resize events to all the
rest? Code snippet follows:

----- ( snippet ) -----

聽聽聽聽edit_tasks_button = wxButton (self, 1001,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽"Edit Tasks")
聽聽聽聽edit_parameters_button = wxButton (self, 1002,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽"Edit Parameters")
聽聽聽聽select_views_button = wxButton (self, 1003,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽"Select Views")
聽聽聽聽update_views_button = wxButton (self, 1004,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽"Update Views")

聽聽聽聽button_hbox = wxBoxSizer (wxHORIZONTAL)
聽聽聽聽button_hbox.Add (edit_tasks_button, 25, wxEXPAND |
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽wxALL, 2)
聽聽聽聽button_hbox.Add (edit_parameters_button, 25, wxEXPAND |
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽wxALL, 2)
聽聽聽聽button_hbox.Add (select_views_button, 25, wxEXPAND |
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽wxALL, 2)
聽聽聽聽button_hbox.Add (update_views_button, 25, wxEXPAND |
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽wxALL, 2)

聽聽聽聽self.SetAutoLayout (true)
聽聽聽聽self.SetSizer (button_hbox)

----- ( end ) -----

Symptoms are that if you horizontally resize the window that
contains this snippet (and not a lot else) then the first
button scales up to take over 50% of the window until you
reach roughly an increment of 100 in the window width (for
instance, it goes weird between 398 and 399). At this point,
the first button leaps back down to having 25% of the space,
at the same time that the rest of the buttons (which weren't
scaling at all until now) also increase size so that they
have 25% each as well.

Any ideas anyone? Does this do weird things on other people's
systems, or is it just the machines here? Again, this code
has identical behaviour on all the Linux boxes here that I've
tried it on, and on my Linux box at home. We're all running
wxPython 2.2.1 - should we upgrade to 2.2.2, would that help
with the odd stuff I'm seeing here?

Regards,
Denny

路路路

----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Symptoms are that if you horizontally resize the window that
contains this snippet (and not a lot else) then the first
button scales up to take over 50% of the window until you
reach roughly an increment of 100 in the window width (for
instance, it goes weird between 398 and 399). At this point,
the first button leaps back down to having 25% of the space,
at the same time that the rest of the buttons (which weren't
scaling at all until now) also increase size so that they
have 25% each as well.

Looks like a problem with the proportional calculations. Note that they are
proportions, not percentages, so if you use 1 instead of 25 then you'll get
the behavior you're looking for.

路路路

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users