Sizer.Show(*crash*) - the right way to hide a control?

from wxWindows doc:

···

------------------------------------------

wxSizer::Show

void Show(wxWindow* window, bool show = TRUE)

void Show(wxSizer* sizer, bool show = TRUE)

Shows or hides a window or sizer. To make a sizer item disappear or reappear, use Show() followed by Layout().

-----------------------------------------

This says to me that I can hide a sizer (per second scheme). I assume I can hide a sizer contained within a sizer.

Trying that within my program generates an Exception dialog window. Until now, all unhandled exceptions I triggered all went to stdout.

I replicated this in PyCrust thusly:

import wx
outer = wx.BoxSizer()
inner = wx.BoxSizer()
outer.Add(inner)
outer.Show(inner, False)

The resulting dialog is labeled 'unhandled exception', offering Abort, Retry, Ignore.

This kills PyCrust (and my program, too)

Repeating the experiment in PythonWin IDE also kills it. However, I get a MSW dialog reporting a fatal error in pythonw.exe. Skips over the exception dialog.

--------------------------------------
Experimenting, I find I can use the first form:

sizer.Show(control, False)

This works. But this seems to offer little utility if it is limited to Show()ing a single control, rather than a Sizer. (wx.Window.Show()already permits hiding a given control).

Have I found a bug? What's the best way to hide a sizer-ful of controls without hiding them individually? Did someone say you can put them all on a panel, then hide the panel?

How about a collection of controls as a property of the sizer? Is such a thing available or do you roll your own? A better way?

-------------------------------------
Win2000 SP4
ActiveState Python 2.3.2
wxPython 2.5.1.5

Jim Peterson wrote:

from wxWindows doc:
------------------------------------------

wxSizer::Show

void Show(wxWindow* window, bool show = TRUE)

void Show(wxSizer* sizer, bool show = TRUE)

Shows or hides a window or sizer. To make a sizer item disappear or reappear, use Show() followed by Layout().

-----------------------------------------

This says to me that I can hide a sizer (per second scheme). I assume I can hide a sizer contained within a sizer.

Trying that within my program generates an Exception dialog window. Until now, all unhandled exceptions I triggered all went to stdout.

Because this is a C++ exception. I've fixed the bug.

···

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