[wxPython] Filebrowsebutton broken - Python 2.1 and 2.2?

I spent some time experimenting with the demo code, and have found the cause
of the problem. It appears that using a "-1" in the size parameter causes
the controls not to appear. I changed the demo code from this:

        self.fbb = FileBrowseButton(self, -1, wxPoint(20,20), wxSize(450,
-1),
                                    changeCallback = self.fbbCallback)
        self.fbbh = FileBrowseButtonWithHistory(self, -1, wxPoint(20, 50),
                                                wxSize(450, -1),
                                                #changeCallback =
self.fbbhCallback
                                                )
        self.dbb = DirBrowseButton(self, -1, wxPoint(20,80), wxSize(450,-1),
                                    changeCallback = self.dbbCallback)

to this:

        self.fbb = FileBrowseButton(self, -1, wxPoint(20,20), wxSize(450,
30),
                                    changeCallback = self.fbbCallback)

        self.fbbh = FileBrowseButtonWithHistory(self, -1, wxPoint(20, 50),
                                                wxSize(450, 30),
                                                #changeCallback =
self.fbbhCallback
                                                )
        self.dbb = DirBrowseButton(self, -1, wxPoint(20,80), wxSize(450,30),
                                    changeCallback = self.dbbCallback)

and now the controls appear as they should and work correctly. I then went
back to my two apps that use these controls, changed the default from -1 to
an appropriate size, and all is right with the world once more.

After doing this, I remembered I had the same size issue with
wxScrolledWindow two days ago. When creating a scrolled window, I used
wxDefaultSize as the default, and none of my window contents showed. I got
rid of the default size and used "parent.GetClientSize()" instead, and all
the content appeared.

It looks as if something has changed in wxWindows or wxPython regarding
window sizing when the default is specified.

That is as much as I can offer for now.

I spent some time experimenting with the demo code, and have found the

cause

of the problem. It appears that using a "-1" in the size parameter causes
the controls not to appear.

Do the -1's (or wxDefaultSize) work if you make this change in
filebrowsebutton.py? At line 114 change this:

        if size.width != -1 or size.height != -1:
            self.SetSize(size)

to this:

        self.SetDimensions(-1, -1, size.width, size.height,
wxSIZE_USE_EXISTING)

···

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