My app's Notebook looks fine on Linux (two pages with a few things
inside them), but when I bring my app over to Windows:
- the tabs are visibly missing
- all notebook page contents are visibly overlayed on top of
each other
- no assertions or exceptions occur to indicate that something
is wrong
I haven't distilled this down yet, but I'm building my components like
so:
nb = wxNotebook(someSplitter, SOME_ID)
p = MyCustomPanel(nb)
nb.addPage(p, 'Foo')
My app's Notebook looks fine on Linux (two pages with a few things inside them), but when I bring my app over to Windows:
- the tabs are visibly missing
- all notebook page contents are visibly overlayed on top of
each other
- no assertions or exceptions occur to indicate that something
is wrong
I haven't distilled this down yet, but I'm building my components like so:
I don't see anything wrong in this code. Does the problem correct itself if the frame is resized? If so then it is a problem of the initial size event happening before you add all the windows to the frame. Try calling frame.SendSizeEvent() after everything has been created.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Nope. Resizing maintains all the contents of all the pages in the one
panel with no notebook in site. I'll experiment now with leaving out
pages and let you know what I find.
···
On Thursday 24 April 2003 11:15 am, Robin Dunn wrote:
Chuck Esterbrook wrote:
> My app's Notebook looks fine on Linux (two pages with a few things
> inside them), but when I bring my app over to Windows:
> - the tabs are visibly missing
> - all notebook page contents are visibly overlayed on top of
> each other
> - no assertions or exceptions occur to indicate that something
> is wrong
>
> I haven't distilled this down yet, but I'm building my components
> like so:
>
> nb = wxNotebook(someSplitter, SOME_ID)
> p = MyCustomPanel(nb)
> nb.addPage(p, 'Foo')
>
> from wxPython.lib.PyCrust import shell, version, filling
> splitter = wx.SplitterWindow(nb, -1, size=(640, 480))
> shellWin = shell.Shell(splitter, -1,
> introText="Welcome to PyCrust %s" % version.VERSION)
> namespace = shellWin.interp.locals
> browserWin = filling.Filling(splitter, -1, size=(640, 480),
> rootObject=namespace, rootIsNamespace=1)
> splitter.splitHorizontally(shellWin, browserWin)
> nb.addPage(splitter, 'PyCrust')
>
> Any ideas on what might be "wrong"?
I don't see anything wrong in this code. Does the problem correct
itself if the frame is resized? If so then it is a problem of the
initial size event happening before you add all the windows to the
frame. Try calling frame.SendSizeEvent() after everything has been
created.
On Thursday 24 April 2003 11:15 am, Robin Dunn wrote:
> I don't see anything wrong in this code. Does the problem correct
> itself if the frame is resized? If so then it is a problem of the
> initial size event happening before you add all the windows to the
> frame. Try calling frame.SendSizeEvent() after everything has been
> created.
Nope. Resizing maintains all the contents of all the pages in the one
panel with no notebook in site. I'll experiment now with leaving out
pages and let you know what I find.
Check all of your event handlers to make sure you call event.Skip(),
otherwise you might be blocking some resizing or other updating from
happening. In particular, you'll get bizarre results if you don't
call event.Skip() inside any OnPageChanging or OnPageChanged handlers.
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com/web/pobrien
-----------------------------------------------
"Your source for Python programming expertise."
-----------------------------------------------
I discovered that the display problem with the notebook is that any
child window of the notebook that was not put through addPage() will:
* on GTK: not appear at all, like you would expect
* on Win32: draw its contents all over the notebook
Do you think this is a "wxWindows on Win32" bug? Or a "platforms act
different for this case" bug?
My app has 5 pages in the notebook at all times, but makes them appear
and disappear them via addPage() and removePage(). I do this because
some of them don't make sense under particular conditions (like what
kind of object you have selected in a treeview). And caching them
avoids delays (and possibly unnecessary memory fragmentation).
This approach works like a charm on GTK, but fails miserably on Win32.
Any suggestions?
···
On Thursday 24 April 2003 01:03 pm, Chuck Esterbrook wrote:
On Thursday 24 April 2003 11:15 am, Robin Dunn wrote:
> Chuck Esterbrook wrote:
> > My app's Notebook looks fine on Linux (two pages with a few
> > things inside them), but when I bring my app over to Windows:
> > - the tabs are visibly missing
> > - all notebook page contents are visibly overlayed on top of
> > each other
> > - no assertions or exceptions occur to indicate that something
> > is wrong
> >
> > I haven't distilled this down yet, but I'm building my components
> > like so:
My app has 5 pages in the notebook at all times, but makes them
appear and disappear them via addPage() and removePage(). I do
this because some of them don't make sense under particular
conditions (like what kind of object you have selected in a
treeview). And caching them avoids delays (and possibly
unnecessary memory fragmentation).
This approach works like a charm on GTK, but fails miserably on
Win32.
Yes, a Show(False) right after creating the hidden pages fixes the problems.
Thanks Donnal!
BTW I'm documenting all my fixes and will post them to the list and/or wiki when I'm done.
Also, next week I'll finalize the Windows survey results.
···
On Friday 25 April 2003 02:27 am, Donnal Walter wrote:
--- Chuck Esterbrook <ChuckEsterbrook@yahoo.com> wrote:
> My app has 5 pages in the notebook at all times, but makes them
> appear and disappear them via addPage() and removePage(). I do
> this because some of them don't make sense under particular
> conditions (like what kind of object you have selected in a
> treeview). And caching them avoids delays (and possibly
> unnecessary memory fragmentation).
>
> This approach works like a charm on GTK, but fails miserably on
> Win32.
>
> Any suggestions?
This sounds much too simple, but *in addition* to addPage() and
removePage(), could you use Show(True) and Show(False)? Just a
thought.
I discovered that the display problem with the notebook is that any child window of the notebook that was not put through addPage() will:
* on GTK: not appear at all, like you would expect
* on Win32: draw its contents all over the notebook
Do you think this is a "wxWindows on Win32" bug? Or a "platforms act different for this case" bug?
The latter I think.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!