class Fl_Choice : public Fl_Menu_

This is a button that when pushed pops up a menu (or hierarchy of menus) defined by an array of Fl_Menu objects. Motif calls this an OptionButton.

The only difference between this and a Fl_Menu_Button is that the name of the most recent chosen menu item is displayed inside the box, while the label is displayed outside the box. However, since the use of this is most often to control a single variable rather than do individual callbacks, some of the Fl_Menu_Button methods are redescribed here in those terms.

When the user picks an item off the menu the value() is set to that item and then the callback is done.

All three mouse buttons pop up the menu. The Forms behavior of the first two buttons to increment/decrement the choice is not implemented. This could be added with a subclass, however.

The menu will also pop up in response to shortcuts indicated by putting a '&' character in the label(). See Fl_Button for a description of this.

Typing the shortcut() of any of the items will do exactly the same as when you pick the item with the mouse. The '&' character in item names are only looked at when the menu is popped up, however.

Fl_Choice::Fl_Choice(int,int,int,int,const char * =0);

The constructor sets menu() to null. See Fl_Menu_ for the methods to set or change the menu!

int Fl_Choice::value() const ;
int Fl_Choice::value(int);
int Fl_Choice::value(const Fl_Menu *);

The value is the index into the Fl_Menu array of the last item chosen by the user. It is zero initially. You can set it as an integer, or set it with a pointer to a menu item. The set routines return non-zero if the new value is different than the old one. Changing it causes a redraw().

int Fl_Widget::changed() const;
void Fl_Widget::set_changed();
void Fl_Widget::clear_changed();

This value is true if the user picks a different value. It is turned off by value(x) and just before doing a callback (the callback can turn it back on if desired).

uchar Fl_Widget::when() const;
void Fl_Widget::when(uchar);

Controls when callbacks are done. The following values are useful, the default value is FL_WHEN_RELEASE:

Fl_Boxtype Fl_Choice::down_box() const ;
void Fl_Choice::down_box(Fl_Boxtype);

Get or set the box to draw while the menu is popped up. By default this is FL_DOWN_BOX.

uchar Fl_Choice::down_color() const ;
void Fl_Choice::down_color(uchar);

Get or set the color to draw the box while the menu is popped up. By default this is gray. This is actually an alias for color2().