Hi (Robin),
I got a bug report from a Phoenix user regarding the use of
SetStatusWidths for a wx.StatusBar. there is no error message, but the
user claims it doesn't work. The (not-runnable) sample included was:
# A Statusbar in the bottom of the window
self.CreateStatusBar(number=2)
ar= self.GetStatusBar()
ly= array('i')
ly=[100, 200]
ar.SetStatusWidths(ly)
# Won't work on Python 3.2 and wxPhoenix r73041
# In Python 2.7 and wxPython 2.9 it does.
I didn' test it (yet), but I can see that the documentation of
wx.StatusBar.SetStatusWidths and the one of wx.Frame.SetStatusWidths
are inconsistent:
1. In wx.Frame.SetStatusWidths:
http://wxpython.org/Phoenix/docs/html/Frame.html#Frame.SetStatusWidths
SetStatusWidths(self, widths_field)
Sets the widths of the fields in the status bar.
Parameters:
n (int) – The number of fields in the status bar. It must be the same
used in CreateStatusBar.
widths_field (int) – Must contain an array of n integers, each of
which is a status field width in pixels. A value of -1 indicates that
the field is variable width; at least one field must be -1. You should
delete this array after calling SetStatusWidths .
There is no "n" parameter in the method signature.
2. In wx.StatusBar.SetStatusWidths:
http://wxpython.org/Phoenix/docs/html/StatusBar.html#StatusBar.SetStatusWidths
SetStatusWidths(self, n, widths_field)
Sets the widths of the fields in the status line.
... skipped docs ...
Parameters:
n (int) – The number of fields in the status bar. Must be equal to the
number passed to SetFieldsCount the last time it was called.
widths_field (int) – Contains an array of n integers, each of which is
either an absolute status field width in pixels if positive or
indicates a variable width field if negative. The special value None
means that all fields should get the same width.
The method seems to use the "n" parameter, but I would say it is
inconsistent with the wx.Frame one if the wx.Frame one does not use
the "n" parameter (and in Classic, it doesn't).
···
--
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://www.infinity77.net
# ------------------------------------------------------------- #
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
# ------------------------------------------------------------- #