[erlang-bugs] wxErlang: using wxSizer with wxStaticBox causes shell crash on frame close

Steve Davis <>
Sat Mar 14 16:25:27 CET 2009

Dan and co.

This is reproable on Windows XP SP3, I don't have another platform to 

The following function contains a line that causes a SHELL crash on 
frame close.

Note! the exactly equivalent code using wxPanel does not cause the crash.

%% Function causes shell to crash on top level window close... why?
box(Parent, Opts) ->
	GxName = get_atom(id, Opts),
	Label = get_string(label, Opts),
	Box = wxStaticBox:new(Parent, -1, Label),

	%% Do sizer stuff...
	Sizer = wxStaticBoxSizer:new(Box, ?wxVERTICAL),	
	wxWindow:setSizer(Box, Sizer),
	SizerFlags = wxSizerFlags:new(),
	ParentSizer = wxWindow:getSizer(Parent),

% layout doesn't doesn't work without the following line...

	wxSizer:add(ParentSizer, Sizer, SizerFlags),

% ...but this sizer addition crashes the SHELL on top level window close

	wxSizer:fit(Sizer, Parent),	
	gx:register(GxName, Box).


More information about the erlang-bugs mailing list