Re: Bug in wx.StatusBar.SetFieldsCount (Phoenix)
Robin Dunn <[email protected]>
| Newsgroups | gmane.comp.python.wxpython.devel |
|---|---|
| Message-ID | <[email protected]> |
Const wrote: > Documentations states: > > SetFieldsCount(self, number=1, widths=None) > widths (int) – An array of n integers interpreted in the same way as > in SetStatusWidths() > > So statusBar.SetFieldsCount(2, [-1, -1]) should work, but it fails with > the error: > > Traceback (most recent call last): > File "C:\users\millsj\sandbox\Py2Py3\wx_cursor.py", line 61, in OnInit > frame = CanvasFrame() > File "C:\users\millsj\sandbox\Py2Py3\wx_cursor.py", line 40, in __init__ > self.statusBar.SetFieldsCount(2, [-1, -1]) > TypeError: StatusBar.SetFieldsCount(): argument 2 has unexpected > type 'list' > > Now, statusBar.SetFieldsCount(1, -1) unexpectedly works, and > statusBar.SetStatusWidths([-1, -1]) works as advertised. In Classic we just ignored the 2nd parameter of SetFieldsCount because there wasn't an easy way to deal with it being an optional arg plus using a typemap. Plus it made more sense to me because that it wouldn't do anything to the width because of the name of the method. I could try to do the same treatment in Phoenix that I do for SetStatusWidths, but since it is an optional parameter that tosses in an extra wrinkle. If the implementation gets tricky I'll just go the Classic route instead and only allow the first parameter for the method. -- Robin Dunn Software Craftsman http://wxPython.org -- You received this message because you are subscribed to the Google Groups "wxPython-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.