diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-18 13:39:04 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-18 13:41:16 +0200 |
| commit | 2392589f052e29803cf4efc57c02ecfa7a7da2f1 (patch) | |
| tree | eba41c04237c8ae20d472a66e008e21bfbb32028 /FL/Fl_Menu_Item.H | |
| parent | 23232d8462d3c4f07b8ddc7277b70d1c34029eca (diff) | |
Return 1 from Fl_Menu_Item::value() for checked items
Previously (FLTK 1.3.x) the return value of a checked menu item
was FL_MENU_VALUE (4) but the docs warned explicitly:
"You should not rely on a particular value, only zero or non-zero."
Diffstat (limited to 'FL/Fl_Menu_Item.H')
| -rw-r--r-- | FL/Fl_Menu_Item.H | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H index 65be443cd..f4b75000b 100644 --- a/FL/Fl_Menu_Item.H +++ b/FL/Fl_Menu_Item.H @@ -304,13 +304,13 @@ struct FL_EXPORT Fl_Menu_Item { */ int radio() const {return flags&FL_MENU_RADIO;} /** Returns the current value of the check or radio item. - This is zero (0) if the menu item is not checked and - non-zero otherwise. You should not rely on a particular value, - only zero or non-zero. - \note The returned value for a checked menu item as of FLTK 1.3.2 - is FL_MENU_VALUE (4), but may be 1 in a future version. + This is zero (0) if the menu item is not checked and non-zero otherwise. + \since 1.4.0 this method returns 1 if the item is checked but you + should not rely on a particular value, only zero or non-zero. + \note The returned value for a checked menu item was FL_MENU_VALUE (4) + before FLTK 1.4.0. */ - int value() const {return flags&FL_MENU_VALUE;} + int value() const {return (flags & FL_MENU_VALUE) ? 1 : 0;} /** Turns the check or radio item "on" for the menu item. Note that this does not turn off any adjacent radio items like set_only() does. |
