![]() | ![]() | ![]() | GIMP Widgets Library Reference Manual | ![]() |
---|
GimpWidgets — A collection of convenient widget constructors, standard callbacks and helper functions.
void gimp_widgets_init (void);GtkWidget * gimp_option_menu_new (gboolean menu_only, ...);GtkWidget * gimp_option_menu_new2 (gboolean menu_only,GCallback menu_item_callback,gpointer menu_item_callback_data,gpointer initial, ...); void gimp_option_menu_set_history (GtkOptionMenu *option_menu,gpointer item_data); void gimp_option_menu_set_sensitive (GtkOptionMenu *option_menu, GimpOptionMenuSensitivityCallback callback,gpointer callback_data);gboolean (*GimpOptionMenuSensitivityCallback) (gpointer item_data,gpointer callback_data);GtkWidget * gimp_radio_group_new (gboolean in_frame, constgchar *frame_title, ...);GtkWidget * gimp_radio_group_new2 (gboolean in_frame, constgchar *frame_title,GCallback radio_button_callback,gpointer radio_button_callback_data,gpointer initial, ...); void gimp_radio_group_set_active (GtkRadioButton *radio_button,gpointer item_data);GtkWidget * gimp_spin_button_new (GtkObject **adjustment,gdouble value,gdouble lower,gdouble upper,gdouble step_increment,gdouble page_increment,gdouble page_size,gdouble climb_rate,guint digits); #define GIMP_SCALE_ENTRY_LABEL (adj) #define GIMP_SCALE_ENTRY_SCALE (adj) #define GIMP_SCALE_ENTRY_SCALE_ADJ (adj) #define GIMP_SCALE_ENTRY_SPINBUTTON (adj) #define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj)GtkObject * gimp_scale_entry_new (GtkTable *table,gint column,gint row, constgchar *text,gint scale_width,gint spinbutton_width,gdouble value,gdouble lower,gdouble upper,gdouble step_increment,gdouble page_increment,guint digits,gboolean constrain,gdouble unconstrained_lower,gdouble unconstrained_upper, constgchar *tooltip, constgchar *help_data); void gimp_scale_entry_set_sensitive (GtkObject *adjustment,gboolean sensitive);GtkObject * gimp_color_scale_entry_new (GtkTable *table,gint column,gint row, constgchar *text,gint scale_width,gint spinbutton_width,gdouble value,gdouble lower,gdouble upper,gdouble step_increment,gdouble page_increment,guint digits, constgchar *tooltip, constgchar *help_data); #define GIMP_RANDOM_SEED_SPINBUTTON (hbox) #define GIMP_RANDOM_SEED_SPINBUTTON_ADJ (hbox)GtkWidget * gimp_random_seed_new (guint32 *seed); #define GIMP_COORDINATES_CHAINBUTTON (sizeentry)GtkWidget * gimp_coordinates_new (GimpUnit unit, constgchar *unit_format,gboolean menu_show_pixels,gboolean menu_show_percent,gint spinbutton_width, GimpSizeEntryUpdatePolicy update_policy,gboolean chainbutton_active,gboolean chain_constrains_ratio, constgchar *xlabel,gdouble x,gdouble xres,gdouble lower_boundary_x,gdouble upper_boundary_x,gdouble xsize_0,gdouble xsize_100, constgchar *ylabel,gdouble y,gdouble yres,gdouble lower_boundary_y,gdouble upper_boundary_y,gdouble ysize_0,gdouble ysize_100);GtkWidget * gimp_pixmap_button_new (gchar **xpm_data, constgchar *text); void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button); void gimp_toggle_button_update (GtkWidget *widget,gpointer data); void gimp_radio_button_update (GtkWidget *widget,gpointer data); void gimp_menu_item_update (GtkWidget *widget,gpointer data); void gimp_int_adjustment_update (GtkAdjustment *adjustment,gpointer data); void gimp_uint_adjustment_update (GtkAdjustment *adjustment,gpointer data); void gimp_float_adjustment_update (GtkAdjustment *adjustment,gpointer data); void gimp_double_adjustment_update (GtkAdjustment *adjustment,gpointer data); void gimp_unit_menu_update (GtkWidget *widget,gpointer data);GtkWidget * gimp_table_attach_aligned (GtkTable *table,gint column,gint row, constgchar *label_text,gfloat xalign,gfloat yalign,GtkWidget *widget,gint colspan,gboolean left_align);
GtkWidget * gimp_option_menu_new (gboolean menu_only, ...);
Convenience function to create a
The va_list describing the
The menu item's label. | |
The callback which will be connected to the menu item's "activate" signal | |
The callback data which will be used in | |
The menu item's user_data which will be set with
| |
A pointer to store the created menu item in. | |
menu_only : | TRUE if the function should return a |
... : | A NULL-terminated va_list describing the menu items. |
Returns : | A |
GtkWidget * gimp_option_menu_new2 (gboolean menu_only,GCallback menu_item_callback,gpointer menu_item_callback_data,gpointer initial, ...);
Convenience function to create a
The va_list describing the
The menu item's label. | |
The menu item's user_data which will be set with
| |
A pointer to store the created menu item in. |
menu_only : | TRUE if the function should return a |
menu_item_callback : | The callback each menu item's "activate" signal will be connected with. |
menu_item_callback_data : |
The data which will be passed to |
initial : | The item_data of the initially selected menu item. |
... : | A NULL-terminated va_list describing the menu items. |
Returns : | A |
void gimp_option_menu_set_history (GtkOptionMenu *option_menu,gpointer item_data);
Iterates over all entries in a
option_menu : | A |
item_data : | The item_data of the menu item you want to select. |
void gimp_option_menu_set_sensitive (GtkOptionMenu *option_menu, GimpOptionMenuSensitivityCallback callback,gpointer callback_data);
Calls the given callback for each item in the menu and passes it the item_data and the callback_data. The menu item's sensitivity is set according to the return value of this function.
option_menu : | a |
callback : | a function called for each item in the menu to determine the the sensitivity state. |
callback_data : | data to pass to the callback function. |
gboolean (*GimpOptionMenuSensitivityCallback) (gpointer item_data,gpointer callback_data);
item_data : | |
callback_data : | |
Returns : |
GtkWidget * gimp_radio_group_new (gboolean in_frame, constgchar *frame_title, ...);
Convenience function to create a group of radio buttons embedded into
a
The va_list describing the
The radio button's label. | |
The callback which will be connected to the radio button's "toggled" signal | |
The callback data which will be used in | |
The radio button's user_data which will be set with
| |
A pointer to store the created radio button in. | |
in_frame : | TRUE if you want a |
frame_title : | The title of the Frame or NULL if you don't want a title. |
... : | A NULL-terminated va_list describing the radio buttons. |
Returns : | A |
GtkWidget * gimp_radio_group_new2 (gboolean in_frame, constgchar *frame_title,GCallback radio_button_callback,gpointer radio_button_callback_data,gpointer initial, ...);
Convenience function to create a group of radio buttons embedded into
a
The va_list describing the
The radio button's label. | |
The radio button's user_data which will be set with
| |
A pointer to store the created radio button in. |
in_frame : | TRUE if you want a |
frame_title : | The title of the Frame or NULL if you don't want a title. |
radio_button_callback : | The callback each button's "toggled" signal will be connected with. |
radio_button_callback_data : |
The data which will be passed to |
initial : | The item_data of the initially pressed radio button. |
... : | A NULL-terminated va_list describing the radio buttons. |
Returns : | A |
void gimp_radio_group_set_active (GtkRadioButton *radio_button,gpointer item_data);
Calls
radio_button : | Pointer to a |
item_data : | The item_data of the radio button you want to select. |
GtkWidget * gimp_spin_button_new (GtkObject **adjustment,gdouble value,gdouble lower,gdouble upper,gdouble step_increment,gdouble page_increment,gdouble page_size,gdouble climb_rate,guint digits);
This function is a shortcut for
adjustment : | Returns the spinbutton's |
value : | The initial value of the spinbutton. |
lower : | The lower boundary. |
upper : | The uppper boundary. |
step_increment : | The spinbutton's step increment. |
page_increment : | The spinbutton's page increment (mouse button 2). |
page_size : | The spinbutton's page size. |
climb_rate : | The spinbutton's climb rate. |
digits : | The spinbutton's number of decimal digits. |
Returns : | A |
#define GIMP_SCALE_ENTRY_LABEL(adj)
Returns the scale_entry's
adj : | The |
#define GIMP_SCALE_ENTRY_SCALE(adj)
Returns the scale_entry's
adj : | The |
#define GIMP_SCALE_ENTRY_SCALE_ADJ(adj)
Returns the
adj : | The |
#define GIMP_SCALE_ENTRY_SPINBUTTON(adj)
Returns the scale_entry's
adj : | The |
#define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj)
Returns the
adj : | The |
GtkObject * gimp_scale_entry_new (GtkTable *table,gint column,gint row, constgchar *text,gint scale_width,gint spinbutton_width,gdouble value,gdouble lower,gdouble upper,gdouble step_increment,gdouble page_increment,guint digits,gboolean constrain,gdouble unconstrained_lower,gdouble unconstrained_upper, constgchar *tooltip, constgchar *help_data);
This function creates a
table : | The |
column : | The column to start with. |
row : | The row to attach the widgets. |
text : | The text for the |
scale_width : | The minimum horizontal size of the |
spinbutton_width : | The minimum horizontal size of the |
value : | The initial value. |
lower : | The lower boundary. |
upper : | The upper boundary. |
step_increment : | The step increment. |
page_increment : | The page increment. |
digits : | The number of decimal digits. |
constrain : | TRUE if the range of possible values of the
|
unconstrained_lower : | The spinbutton's lower boundary if constrain == FALSE. |
unconstrained_upper : | The spinbutton's upper boundary if constrain == FALSE. |
tooltip : | A tooltip message for the scale and the spinbutton. |
help_data : | The widgets' help_data (see gimp_help_set_help_data()). |
Returns : | The |
void gimp_scale_entry_set_sensitive (GtkObject *adjustment,gboolean sensitive);
Sets the sensitivity of the scale_entry's
adjustment : | a |
sensitive : | a boolean value with the same semantics as the sensitive
parameter of |
GtkObject * gimp_color_scale_entry_new (GtkTable *table,gint column,gint row, constgchar *text,gint scale_width,gint spinbutton_width,gdouble value,gdouble lower,gdouble upper,gdouble step_increment,gdouble page_increment,guint digits, constgchar *tooltip, constgchar *help_data);
This function creates a
table : | The |
column : | The column to start with. |
row : | The row to attach the widgets. |
text : | The text for the |
scale_width : | The minimum horizontal size of the |
spinbutton_width : | The minimum horizontal size of the |
value : | The initial value. |
lower : | The lower boundary. |
upper : | The upper boundary. |
step_increment : | The step increment. |
page_increment : | The page increment. |
digits : | The number of decimal digits. |
tooltip : | A tooltip message for the scale and the spinbutton. |
help_data : | The widgets' help_data (see gimp_help_set_help_data()). |
Returns : | The |
#define GIMP_RANDOM_SEED_SPINBUTTON(hbox)
Returns the random_seed's
hbox : | The |
#define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox)
Returns the
hbox : | The |
GtkWidget * gimp_random_seed_new (guint32 *seed);
Creates a widget that allows the user to control how the random number generator is initialized.
seed : | A pointer to the variable which stores the random seed. |
Returns : | A |
#define GIMP_COORDINATES_CHAINBUTTON(sizeentry)
Returns the GimpChainButton which is attached to the GimpSizeEntry.
sizeentry : | The GimpSizeEntry returned by gimp_coordinates_new(). |
GtkWidget * gimp_coordinates_new (GimpUnit unit, constgchar *unit_format,gboolean menu_show_pixels,gboolean menu_show_percent,gint spinbutton_width, GimpSizeEntryUpdatePolicy update_policy,gboolean chainbutton_active,gboolean chain_constrains_ratio, constgchar *xlabel,gdouble x,gdouble xres,gdouble lower_boundary_x,gdouble upper_boundary_x,gdouble xsize_0,gdouble xsize_100, constgchar *ylabel,gdouble y,gdouble yres,gdouble lower_boundary_y,gdouble upper_boundary_y,gdouble ysize_0,gdouble ysize_100);
Convenience function that creates a GimpSizeEntry with two fields for x/y coordinates/sizes with a GimpChainButton attached to constrain either the two fields' values or the ratio between them.
unit : | The initial unit of the GimpUnitMenu. |
unit_format : | A printf-like unit-format string as is used with gimp_unit_menu_new(). |
menu_show_pixels : | TRUE if the GimpUnitMenu should contain an item for GIMP_UNIT_PIXEL. |
menu_show_percent : | TRUE if the GimpUnitMenu should contain an item for GIMP_UNIT_PERCENT. |
spinbutton_width : | The horizontal size of the GimpSizeEntry's
|
update_policy : | The update policy for the GimpSizeEntry. |
chainbutton_active : | TRUE if the attached GimpChainButton should be active. |
chain_constrains_ratio : | TRUE if the chainbutton should constrain the fields' aspect ratio. If FALSE, the values will be constrained. |
xlabel : | The label for the X coordinate. |
x : | The initial value of the X coordinate. |
xres : | The horizontal resolution in DPI. |
lower_boundary_x : | The lower boundary of the X coordinate. |
upper_boundary_x : | The upper boundary of the X coordinate. |
xsize_0 : | The X value which will be treated as 0%. |
xsize_100 : | The X value which will be treated as 100%. |
ylabel : | The label for the Y coordinate. |
y : | The initial value of the Y coordinate. |
yres : | The vertical resolution in DPI. |
lower_boundary_y : | The lower boundary of the Y coordinate. |
upper_boundary_y : | The upper boundary of the Y coordinate. |
ysize_0 : | The Y value which will be treated as 0%. |
ysize_100 : | The Y value which will be treated as 100%. |
Returns : | The new GimpSizeEntry. |
GtkWidget * gimp_pixmap_button_new (gchar **xpm_data, constgchar *text);
Convenience function that creates a
xpm_data : | The XPM data which will be passed to gimp_pixmap_new(). |
text : | An optional text which will appear right of the pixmap. |
Returns : | The new |
void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);
If you attached a pointer to a
You can attach an arbitrary list of widgets by attaching another "set_sensitive" data pointer to the first widget (and so on...).
This function can also set the sensitive state according to the toggle button's inverse "active" state by attaching widgets with the "inverse_sensitive" key.
toggle_button : | The |
void gimp_toggle_button_update (GtkWidget *widget,gpointer data);
Note that this function calls gimp_toggle_button_sensitive_update().
widget : | A |
data : | A pointer to a |
void gimp_radio_button_update (GtkWidget *widget,gpointer data);
Note that this function calls gimp_toggle_button_sensitive_update().
widget : | A |
data : | A pointer to a |
void gimp_menu_item_update (GtkWidget *widget,gpointer data);
widget : | A |
data : | A pointer to a |
void gimp_int_adjustment_update (GtkAdjustment *adjustment,gpointer data);
Note that the
adjustment : | A |
data : | A pointer to a |
void gimp_uint_adjustment_update (GtkAdjustment *adjustment,gpointer data);
Note that the
adjustment : | A |
data : | A pointer to a |
void gimp_float_adjustment_update (GtkAdjustment *adjustment,gpointer data);
adjustment : | A |
data : | A pointer to a |
void gimp_double_adjustment_update (GtkAdjustment *adjustment,gpointer data);
adjustment : | A |
data : | A pointer to a |
void gimp_unit_menu_update (GtkWidget *widget,gpointer data);
This callback can set the number of decimal digits of an arbitrary number
of
See gimp_toggle_button_sensitive_update() for a description of how to set up the list.
widget : | A GimpUnitMenu. |
data : | A pointer to a |
GtkWidget * gimp_table_attach_aligned (GtkTable *table,gint column,gint row, constgchar *label_text,gfloat xalign,gfloat yalign,GtkWidget *widget,gint colspan,gboolean left_align);
Note that the label_text can be NULL and that the widget will be attached starting at (column + 1) in this case, too.
table : | The |
column : | The column to start with. |
row : | The row to attach the widgets. |
label_text : | The text for the |
xalign : | The horizontal alignment of the |
yalign : | The vertival alignment of the |
widget : | The |
colspan : | The number of columns the widget will use. |
left_align : | TRUE if the widget should be left-aligned. |
Returns : | The created |
<< GimpQueryBox | GimpStock >> |