|
|
On Tuesday, November 24, 2020 at 12:40:01 PM UTC-5 ggar...@gmail.com wrote:
El 24/11/20 a las 14:31, david allen escribió:
> My impression is that clicking X in the title bar executes the
> window's destructor, but that does not seem to be the case for a popup
> window. In the attached demo the intent is for clicking the X has the
> same effect as clicking the close button. It appears that the
> destructor is never called.
>
Indeed. That seems to be the case. You can fix it by attaching the
callback to window instead, like:
PopUPWin::PopUPWin(int x, int y, int w, int h, const char* label):
Fl_Double_Window(x, y, w, h, label)
{
hide();
set_modal();
show();
begin();
button = new Fl_Button(x+10, y+10, 100, 30, "Close");
end();
button->callback(close_CB, this);
callback( close_CB, this ); // new line
}
Perfect. Thanks!
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/0dcf6313-26cd-4216-9fae-dc460ebab7f7n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |