Previous: , Up: Spinner Object   [Contents][Index]


17.6.5 Spinner Attributes

Please don’t change the boxtype from FL_NO_BOX.

The label color and font can be set using the normal fl_set_object_lcolor(), fl_set_object_lsize() and fl_set_object_lstyle() functions. The color of the input field of a spinner object can be set via using fl_set_object_color() where the first color argument (col1) controls the color of the input field when it is not selected and the second (col2) is the color when selected.

Instead of creating a plethora of functions to influence all the other aspects of how the spinner is drawn (colors, font types etc.) the user is given direct access to the sub-objects of a spinner. To this end three functions exist:

FL_OBJECT *fl_get_spinner_input(FL_OBJECT *obj);
FL_OBJECT *fl_get_spinner_up_button(FL_OBJECT *obj);
FL_OBJECT *fl_get_spinner_down_button(FL_OBJECT *obj);

They return the addresses of the objects the spinner object is made up from, i.e., that of the input field and the buttons for increasing and decreasing the spinner’s value. These then can be used to set or query the way the individual component objects are drawn. The addresses of these sub-objects shouldn’t be used for any other purposes, especially their callback function may never be changed!