Author Topic: wxsmith app crash  (Read 2842 times)

Offline airc

  • Multiple posting newcomer
  • *
  • Posts: 34
wxsmith app crash
« on: April 03, 2014, 11:12:59 am »
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


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2552
Re: wxsmith app crash
« Reply #1 on: April 03, 2014, 01:42:08 pm »
i can't reproduce the crash...
did you tried to debug?
what compiler, compiler version, os, os version, wxWidgets version....

greetings

Offline airc

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: wxsmith app crash
« Reply #2 on: April 03, 2014, 02:20:36 pm »
OS : win7 32bit
gcc: default C:B compiler (4.7.1)
wxwidgets : 2.8.12

i attached the wxsmith file

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2552
Re: wxsmith app crash
« Reply #3 on: April 03, 2014, 02:54:48 pm »
it would be easier if you post/upload a minimal example project, with source code...

Offline airc

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: wxsmith app crash
« Reply #4 on: April 03, 2014, 03:10:15 pm »
thanks BlueHazzard
this is the project

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2552
Re: wxsmith app crash
« Reply #5 on: April 03, 2014, 03:30:48 pm »
Hi,
i can reproduce your bug, and it is indeed a but in wxSmith...
if you look at the generated code:
Code: [Select]
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