| 1 |
/* File : Fl_Choice.i */ |
| 2 |
//%module Fl_Choice |
| 3 |
|
| 4 |
%feature("docstring") ::Fl_Choice |
| 5 |
""" |
| 6 |
This is a button that when pushed pops up a menu (or hierarchy of menus) |
| 7 |
defined by an array of Fl_Menu_Item objects. Motif calls this an OptionButton. |
| 8 |
|
| 9 |
The only difference between this and a Fl_Menu_Button is that the name of |
| 10 |
the most recent chosen menu item is displayed inside the box, while the |
| 11 |
label is displayed outside the box. However, since the use of this is most |
| 12 |
often to control a single variable rather than do individual callbacks, some |
| 13 |
of the Fl_Menu_Button methods are redescribed here in those terms. |
| 14 |
|
| 15 |
When the user picks an item off the menu the value() is set to that item and |
| 16 |
then the item's callback is done with the menu_button as the Fl_Widget |
| 17 |
argument. If the item does not have a callback the menu_button's callback is |
| 18 |
done instead. |
| 19 |
|
| 20 |
All three mouse buttons pop up the menu. The Forms behavior of the first two |
| 21 |
buttons to increment/decrement the choice is not implemented. This could be |
| 22 |
added with a subclass, however. |
| 23 |
|
| 24 |
The menu will also pop up in response to shortcuts indicated by putting a '&' |
| 25 |
character in the label(). See Fl_Button for a description of this. |
| 26 |
|
| 27 |
Typing the shortcut() of any of the items will do exactly the same as when |
| 28 |
you pick the item with the mouse. The '&' character in item names are only |
| 29 |
looked at when the menu is popped up, however. |
| 30 |
""" ; |
| 31 |
|
| 32 |
%{ |
| 33 |
#include "FL/Fl_Choice.H" |
| 34 |
%} |
| 35 |
|
| 36 |
%include "macros.i" |
| 37 |
|
| 38 |
CHANGE_OWNERSHIP(Fl_Choice) |
| 39 |
|
| 40 |
%include "FL/Fl_Choice.H" |
| 41 |
|
| 42 |
|