diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-07-17 20:33:45 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-07-17 20:33:45 +0000 |
| commit | 924e8a92d117a7667c075451668df85fce9ebac0 (patch) | |
| tree | 7499bf4893acfe5a2fc31dac9990d36f1d874e29 /src | |
| parent | f0fcbb38663cc292650957402c363170b3e40602 (diff) | |
Fixed crash on mixed use of keyboard and mouse for Fl_Menu_Button (STR #1356)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5259 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Menu.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index afb1ade0d..3aee4efcb 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -533,6 +533,9 @@ static void setitem(int m, int n) { static int forward(int menu) { // go to next item in menu menu if possible menustate &pp = *p; + // Fl_Menu_Button can geberate menu=-1. This line fixes it and selectes the first item. + if (menu==-1) + menu = 0; menuwindow &m = *(pp.p[menu]); int item = (menu == pp.menu_number) ? pp.item_number : m.selected; while (++item < m.numitems) { |
