diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2009-12-25 20:53:22 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2009-12-25 20:53:22 +0000 |
| commit | 38c15442a418a238462b1207adb681cf992edab7 (patch) | |
| tree | 3588313acf89c15ac6ad705038464304c7849ec7 /fluid/function_panel.cxx | |
| parent | 9a505ef44c8433c8f58c68b79888c6f52c7739db (diff) | |
Changed widget bin closing behavior when pressing ESC (which IMO should quit the app, not the widget bin).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6981 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/function_panel.cxx')
| -rw-r--r-- | fluid/function_panel.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx index d1a25238a..e36a9439b 100644 --- a/fluid/function_panel.cxx +++ b/fluid/function_panel.cxx @@ -34,6 +34,8 @@ extern class Fl_Pixmap *pixmap[]; extern class Fl_Type *Fl_Type_make(const char*); extern void select_only(Fl_Type*); +extern void exit_cb(Fl_Widget*, void*); +extern void toggle_widgetbin_cb(Fl_Widget*, void*); Fl_Double_Window *function_panel=(Fl_Double_Window *)0; @@ -595,8 +597,16 @@ void type_make_cb(Fl_Widget*,void*d) { Fl_Window *widgetbin_panel=(Fl_Window *)0; +static void cb_widgetbin_panel(Fl_Window* o, void* v) { + if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) + exit_cb((Fl_Widget*)o, v); +else + toggle_widgetbin_cb((Fl_Widget*)o, v); +} + Fl_Window* make_widgetbin() { { widgetbin_panel = new Fl_Window(550, 85, "Widget Bin"); + widgetbin_panel->callback((Fl_Callback*)cb_widgetbin_panel); widgetbin_panel->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE)); { Fl_Group* o = new Fl_Group(3, 3, 79, 79); { Fl_Button* o = new Fl_Button(5, 5, 24, 24); |
