|
From: John S. <joh...@ja...> - 2023-07-26 14:21:51
|
I'm running on Win11 with v1.7.50
When I use this:
new FXButton(bottom_HF_0, "Close", nullptr, this,
FXDialogBox::ID_CLOSE, FRAME_RAISED | FRAME_THICK |
BUTTON_DEFAULT);
the program crashes:
when I use this
new FXButton(bottom_HF_0, "Close", nullptr, this,
FXDialogBox::ID_CANCEL, FRAME_RAISED | FRAME_THICK |
BUTTON_DEFAULT);
it doesn't.what's the difference?
When it crashed it crashes in here on the "x: delete this;" line
// Attempt to close the window, return true if actually closed
FXbool FXTopWindow::close(FXbool notify){
register FXWindow *window;
// Ask target if desired
if(!notify || !target ||
!target->tryHandle(this,FXSEL(SEL_CLOSE,message),NULL)){
// Target will receive no further messages from us
setTarget(NULL);
setSelector(0);
// If there was another main level window still visible,
that's all we do
for(window=getRoot()->getFirst(); window;
window=window->getNext()){
if(window!=this &&
window->isMemberOf(FXMETACLASS(FXMainWindow))){
goto x;
}
}
// We've just hidden the last remaining top level window:-
quit the application
getApp()->handle(this,FXSEL(SEL_COMMAND,FXApp::ID_QUIT),NULL);
// Self destruct
x: delete this;
// Was closed
return true;
}
return false;
}
Kind regards,
js
|