wxPython – SetStatusWidths() function in wx.StatusBar
In this article we are going to learn about SetStatusWidths() function associated with wx.StatuBar class of wxPython. SetStatusWidths() function sets the widths of the fields in the status line.
There are two types of fields: fixed widths and variable-width fields. For the fixed-width fields you should specify their (constant) width in pixels. For the variable width fields, specify a negative number which indicates how the field should expand: the space left for all variable width fields is divided between them according to the absolute value of this number. A variable-width field with width of -2 gets twice as much of it as a field with width -1 and so on.
Syntax: wx.StatuBar.SetStatusWidths(self, widths)
Parameter Input Type Description widths list of ints The text to be set. Use an empty string (“”) to clear the field. i 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.