Extremely long lines: feature or bug?
A.J. Bonnema
abonnema at xs4all.nl
Sat Feb 9 23:09:23 PST 2008
Hi all,
I just found out a phenomenon on the wxPython sizers and I wonder =
whether this is a feature or a bug. The sample program attached to this =
message will show you what I mean:
1. If you run the sample as-is, you get one extremely long field (a lot =
longer than the window or the screen)
2. a. If you change the parameter FLD_FACTOR from 1 to zero, all fields =
return to normal lengh.
b. In stead of a, if you change the parameter of LBL_FACTOR from 50 =
to f.i. 2, the fields also return to normal length.
We have two BoxSizer here, both horizontal. The first contains a field =
and a label controlled by weights. The second contains an option group, =
controlled by a wx.EXPAND.
What happens here, is that the option sizer gets expanded to well beyond =
the window's borders, because the previous sizer is expanded because of =
the weights. I suspect, that a factor of 50 means, that -- whatever the =
window size -- the label will be extended to be 50 times the minimum =
length of the field on the same sizer. Unless the field has factor zero, =
in which case there is no reference for the label to expand.
What bugs me, is that wx.EXPAND and weights can get *way* beyond the =
window width. You could argue that a ratio of 50 to 1 is bullocks and =
the function works as designed, but you also argue that the sum of the =
lengths should never exceed the window itself.
So, I am left wondering: is this a feature or a bug?
Guus.
-- =
A.J. Bonnema, Leiden The Netherlands,
user #328198 (Linux Counter http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample_long_widget.py
Type: text/x-python
Size: 2580 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20080=
210/226345f2/sample_long_widget.py
More information about the wxpython-users
mailing list