| GIMP Library Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> | 
| struct GimpUnitMenu; #define GIMP_UNIT_MENU (obj) | 
| 
 | 
| "unit-changed" void user_function (GimpUnitMenu *gimpunitmenu, | 
This widget provides a 
You can specify the string that will be displayed for each unit by passing a printf-like format string to gimp_unit_menu_new().
The constructor also lets you choose if the menu should contain items for GIMP_UNIT_PIXEL, GIMP_UNIT_PERCENT and a "More..." item which will pop up a dialog for selecting user-defined units.
Whenever the user selects a unit from the menu or the dialog, the "unit_changed" signal will be emitted.
| #define GIMP_UNIT_MENU(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_UNIT_MENU, GimpUnitMenu)) | 
Checks if the passed pointer is a pointer to a GimpUnitMenu and performs the cast if valid.
| 
 | 
Creates a new GimpUnitMenu widget.
The format string supports the following percent expansions:
| % f | Factor (how many units make up an inch) | 
| % y | Symbol (e.g. "''" for GIMP_UNIT_INCH) | 
| % a | Abbreviation | 
| % s | Singular | 
| % p | Plural | 
| %% | Literal percent | 
| format : | A printf-like format string which is used to create the unit strings. | 
| unit : | The initially selected unit. | 
| show_pixels : |  | 
| show_percent : |  | 
| show_custom : |  | 
| Returns : | A pointer to the new GimpUnitMenu widget. | 
| void gimp_unit_menu_set_unit (GimpUnitMenu *gum, GimpUnit unit); | 
Sets a new GimpUnit for the specified GimpUnitMenu.
| GimpUnit gimp_unit_menu_get_unit (GimpUnitMenu *gum); | 
Returns the GimpUnit the user has selected from the GimpUnitMenu.
| void user_function (GimpUnitMenu *gimpunitmenu, | 
This signal is emitted whenever the user selects a GimpUnit from the GimpUnitMenu.