It seems that a button's callback can't be attached
to pressing the enter key.  Is that true?

Thanks
Stan

#include <FL/Fl_Double_Window.H>
#include <FL/Fl.H>
#include <FL/Fl_Button.H>
#include <FL/fl_ask.H>

void btn_cb(Fl_Widget*, void*)
{
        fl_alert("Hello");
}

int main()
{
        Fl_Double_Window win(300, 300);
        Fl_Button* btn = new Fl_Button(50, 50, 20, 100, "button");
        win.end();

        btn->callback(btn_cb);
        btn->when(FL_WHEN_ENTER_KEY_ALWAYS | FL_WHEN_RELEASE_ALWAYS);

        btn->take_focus();
        win.show();
        return Fl::run();
}

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to