Hello,
Thank you for the advice. The callback function helped to solve my problem,
that was what I needed.
Just a small explanation - my SW shall run on a machine as the only visible
application. So a normal user shall not be able to close it, just to shutdown
the machine through menu provided in the application.
Kveto
> #include <stdio.h>
> #include <FL/Fl.H>
> #include <FL/fl_ask.H>
> #include <FL/Fl_Window.H>
>
> void MyCallback(Fl_Widget*w, void*) {
> Fl_Window *win = (Fl_Window*)w;
> switch ( fl_choice("Really close?", "No", "Yes", NULL) ) {
> case 1: // yes
> win->hide(); // closes window (or you could do an exit(0)
> here too)
> return;
>
> case 0: // no
> return; // ignore
> }
> return;
> }
>
> int main() {
> Fl_Window win(300, 300, "win1");
> win.end();
> win.callback(MyCallback); // set callback
> win.show();
> return(Fl::run());
> }
>
> I'm on a linux machine, where ALT-F4 closes the window, and this
> works fine. Didn't try it on windows, but I believe it should work
> the same there as well.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk