reparenting windows and their children

I'm trying to detach a notebook tab's window into a separate frame on command on wxPython 2.5.1.5 on Mac OS X 10.3.

Following an old hint from Robin I GetPage(GetSelection()) the notebook page, then RemovePage() it without destroying it. Then I Reparent() it to the new frame.

This seems to work for the top level window in the hierarchy of the notebook page, but all its children seem to (at least partially) stay on the original notebook page. This has the funny effect that, for example, resizing the new frame if the page was a ScrolledWindow makes the scrollbars resize on the old notebook (even though it's tab is gone). Same with all other children of the moved page.

I tried descending the hierarchy and reparenting the children, but they have the correct parents (i.e. their old parents), so the reparent fails.

Any ideas?

Thanks,
Peter

Peter Gorniak wrote:

I'm trying to detach a notebook tab's window into a separate frame on command on wxPython 2.5.1.5 on Mac OS X 10.3.

Following an old hint from Robin I GetPage(GetSelection()) the notebook page, then RemovePage() it without destroying it. Then I Reparent() it to the new frame.

This seems to work for the top level window in the hierarchy of the notebook page, but all its children seem to (at least partially) stay on the original notebook page. This has the funny effect that, for example, resizing the new frame if the page was a ScrolledWindow makes the scrollbars resize on the old notebook (even though it's tab is gone). Same with all other children of the moved page.

I tried descending the hierarchy and reparenting the children, but they have the correct parents (i.e. their old parents), so the reparent fails.

Any ideas?

Reparenting has never worked on the Mac, something about the implementation prevented it IIRC. That may have changed recently though, I'll try to remember to check it out next time I work on that platform.

ยทยทยท

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