|
|
On 1/26/22 18:51 Apprentice wrote:
Yes it works.
Thanks for confirmation.
Added only a forgotten parentheses at the end!
Ah yes, untested code. Even better that you wrote how to fix it for
other readers.
Thanks
BtExit->callback([](Fl_Widget *button,
void *) {
button->window()->hide();
});
Em quarta-feira, 26 de
janeiro de 2022 às 13:55:23 UTC-3, Albrecht Schlosser
escreveu:
On 1/26/22 16:49 Apprentice wrote:
The solution I could find to close the window was
like this. Of course if someone has a better solution,
thank you too!
BtExit->callback([](Fl_Widget
*, void *data) {
((Fl_Window*)data)->hide();
}, (void*)WinInformations);
If you add more and more code to your lambda _expression_
it seems to become easier to add a static callback...
That said, if you want to close the window that contains the
BtExit button you don't need to "send" the window in the
data pointer, you can also use the window() method on the
exit button which is always in the Fl_Widget pointer,
something like
BtExit->callback([](Fl_Widget
*button, void *) {
button->window()->hide();
};
should work (untested).
--
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/31e5dd63-5b68-e2c7-7cbd-fbedcd6dd99b%40online.de.
[ Direct Link to Message ] | |
|
| |