Deleting a window now raises the Close event immediately, like in Qt components.

[GB.GTK]
* BUG: Deleting a window now raises the Close event immediately, like in Qt components.

[GB.GTK3]
* BUG: Deleting a window now raises the Close event immediately, like in Qt components.
This commit is contained in:
gambas 2020-11-14 16:20:20 +01:00
parent b36254ee7e
commit 5b48b7763a
3 changed files with 9 additions and 2 deletions

View file

@ -206,7 +206,7 @@ public:
bool grab();
void destroy();
virtual void destroy();
void destroyNow() { destroy(); cleanRemovedControls(); }
void lock() { _locked++; }

View file

@ -504,7 +504,7 @@ gMainWindow::gMainWindow(gContainer *par) : gContainer(par)
gMainWindow::~gMainWindow()
{
//fprintf(stderr, "delete window %p %s\n", this, name());
//fprintf(stderr, "delete window %p %s _opened = %d\n", this, name(), _opened);
gApplication::handleFocusNow();
@ -1971,3 +1971,9 @@ void gMainWindow::calcCsdSize()
fprintf(stderr, "calcCsdSize: %s: csd = %d %d\n", name(), _csd_w, _csd_h);
#endif
}
void gMainWindow::destroy()
{
doClose();
gControl::destroy();
}

View file

@ -115,6 +115,7 @@ public:
virtual bool resize(int w, int h);
bool close();
virtual void reparent(gContainer *newpr, int x, int y);
virtual void destroy();
//"Signals"
void (*onOpen)(gMainWindow *sender);