News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

wxsmith app crash

Started by airc, April 03, 2014, 11:12:59 AM

Previous topic - Next topic

airc

hi
can some one reproduce ?
from the attached picture you can see its only a simple window with 3 panels and 1 splitter . it compile fine but crashes when execute.

can some one please tell me what wrong i am doing ?


thanks


BlueHazzard

i can't reproduce the crash...
did you tried to debug?
what compiler, compiler version, os, os version, wxWidgets version....

greetings

airc

OS : win7 32bit
gcc: default C:B compiler (4.7.1)
wxwidgets : 2.8.12

i attached the wxsmith file

BlueHazzard

it would be easier if you post/upload a minimal example project, with source code...

airc

thanks BlueHazzard
this is the project

BlueHazzard

Hi,
i can reproduce your bug, and it is indeed a but in wxSmith...
if you look at the generated code:

85    Panel3 = new wxPanel(SplitterWindow3, ID_PANEL3, wxDefaultPosition, wxSize(297,204), wxSTATIC_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL3"));
86    Panel3->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INACTIVECAPTION));
87    SplitterWindow3->Initialize(Panel3);
88    SplitterWindow1->SplitHorizontally(SplitterWindow2, SplitterWindow3);
89    BoxSizer2->Add(SplitterWindow1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
90    Panel1->SetSizer(BoxSizer2);
91    SetSizer(BoxSizer2);
92    Layout();
93    BoxSizer1->Add(Panel1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
94    SetSizer(BoxSizer1);
95    SetSizer(BoxSizer1);
96    Layout();

in line 91 the sizer for the actual window is set to BoxSizer2 and Layout is called. This is wrong...
then in line 94 and 95 there is duplicated code. If you comment out line 91,92 and 95 your code runs without problems...
i will try to isolate the problem, but i am not a wxSmith developer so  it would be nice if someone from them could look into this...

(i produced this code with loading the wxs file, so maybe the error is located in the loading source. I have not tried to recreate the code in the form editor. The xml structure looks good for me)

greetings