![]() |
![]() |
![]() |
GIMP Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
GimpWidgetsGimpWidgets — A collection of convenient widget constructors, standard callbacks and helper functions. |
enum GimpWidgetsError; GtkWidget * gimp_radio_group_new (gboolean in_frame
,const gchar *frame_title
,...
); GtkWidget * gimp_radio_group_new2 (gboolean in_frame
,const gchar *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_int_radio_group_new (gboolean in_frame
,const gchar *frame_title
,GCallback radio_button_callback
,gpointer radio_button_callback_data
,gint initial
,...
); void gimp_int_radio_group_set_active (GtkRadioButton *radio_button
,gint 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
,const gchar *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
,const gchar *tooltip
,const gchar *help_id
); void gimp_scale_entry_set_sensitive (GtkObject *adjustment
,gboolean sensitive
); void gimp_scale_entry_set_logarithmic (GtkObject *adjustment
,gboolean logarithmic
); gboolean gimp_scale_entry_get_logarithmic (GtkObject *adjustment
); GtkObject * gimp_color_scale_entry_new (GtkTable *table
,gint column
,gint row
,const gchar *text
,gint scale_width
,gint spinbutton_width
,gdouble value
,gdouble lower
,gdouble upper
,gdouble step_increment
,gdouble page_increment
,guint digits
,const gchar *tooltip
,const gchar *help_id
); #define GIMP_RANDOM_SEED_SPINBUTTON (hbox) #define GIMP_RANDOM_SEED_SPINBUTTON_ADJ (hbox) #define GIMP_RANDOM_SEED_TOGGLE (hbox) GtkWidget * gimp_random_seed_new (guint32 *seed
,gboolean *random_seed
); #define GIMP_COORDINATES_CHAINBUTTON (sizeentry) GtkWidget * gimp_coordinates_new (GimpUnit unit
,const gchar *unit_format
,gboolean menu_show_pixels
,gboolean menu_show_percent
,gint spinbutton_width
,GimpSizeEntryUpdatePolicy update_policy
,gboolean chainbutton_active
,gboolean chain_constrains_ratio
,const gchar *xlabel
,gdouble x
,gdouble xres
,gdouble lower_boundary_x
,gdouble upper_boundary_x
,gdouble xsize_0
,gdouble xsize_100
,const gchar *ylabel
,gdouble y
,gdouble yres
,gdouble lower_boundary_y
,gdouble upper_boundary_y
,gdouble ysize_0
,gdouble ysize_100
); void gimp_toggle_button_update (GtkWidget *widget
,gpointer data
); void gimp_radio_button_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
); GtkWidget * gimp_table_attach_aligned (GtkTable *table
,gint column
,gint row
,const gchar *label_text
,gfloat xalign
,gfloat yalign
,GtkWidget *widget
,gint colspan
,gboolean left_align
); void gimp_label_set_attributes (GtkLabel *label
,...
); #define GIMP_WIDGETS_ERROR GQuark gimp_widgets_error_quark (void
);
A collection of convenient widget constructors, standard callbacks and helper functions.
GtkWidget * gimp_radio_group_new (gboolean in_frame
,const gchar *frame_title
,...
);
Convenience function to create a group of radio buttons embedded into a GtkFrame or GtkVBox.
|
TRUE if you want a GtkFrame around the radio button group. |
|
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 GtkFrame or GtkVBox (depending on in_frame ). |
GtkWidget * gimp_radio_group_new2 (gboolean in_frame
,const gchar *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 GtkFrame or GtkVBox.
|
TRUE if you want a GtkFrame around the
radio button group. |
|
The title of the Frame or NULL if you don't want
a title. |
|
The callback each button's "toggled" signal will be connected with. |
|
The data which will be passed to g_signal_connect() . |
|
The item_data of the initially pressed radio button. |
|
A NULL -terminated va_list describing
the radio buttons. |
Returns : |
A GtkFrame or GtkVBox (depending on in_frame ). |
void gimp_radio_group_set_active (GtkRadioButton *radio_button
,gpointer item_data
);
Calls gtk_toggle_button_set_active()
with the radio button that was
created with a matching item_data
.
|
Pointer to a GtkRadioButton. |
|
The item_data of the radio button you want to select. |
GtkWidget * gimp_int_radio_group_new (gboolean in_frame
,const gchar *frame_title
,GCallback radio_button_callback
,gpointer radio_button_callback_data
,gint initial
,...
);
Convenience function to create a group of radio buttons embedded into
a GtkFrame or GtkVBox. This function does the same thing as
gimp_radio_group_new2()
, but it takes integers as item_data
instead of
pointers, since that is a very common case (mapping an enum to a radio
group).
|
TRUE if you want a GtkFrame around the
radio button group. |
|
The title of the Frame or NULL if you don't want
a title. |
|
The callback each button's "toggled" signal will be connected with. |
|
The data which will be passed to g_signal_connect() . |
|
The item_data of the initially pressed radio button. |
|
A NULL -terminated va_list describing
the radio buttons. |
Returns : |
A GtkFrame or GtkVBox (depending on in_frame ). |
void gimp_int_radio_group_set_active (GtkRadioButton *radio_button
,gint item_data
);
Calls gtk_toggle_button_set_active()
with the radio button that was created
with a matching item_data
. This function does the same thing as
gimp_radio_group_set_active()
, but takes integers as item_data
instead
of pointers.
|
Pointer to a GtkRadioButton. |
|
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 gtk_adjustment_new()
and a
subsequent gtk_spin_button_new()
. It also calls
gtk_spin_button_set_numeric()
so that non-numeric text cannot be
entered.
|
Returns the spinbutton's GtkAdjustment. |
|
The initial value of the spinbutton. |
|
The lower boundary. |
|
The uppper boundary. |
|
The spinbutton's step increment. |
|
The spinbutton's page increment (mouse button 2). |
|
Ignored, spin buttons must always have a zero page size. |
|
The spinbutton's climb rate. |
|
The spinbutton's number of decimal digits. |
Returns : |
A GtkSpinButton and its GtkAdjustment. |
#define GIMP_SCALE_ENTRY_LABEL(adj)
|
The GtkAdjustment returned by gimp_scale_entry_new() . |
Returns : |
the scale_entry's GtkLabel. |
#define GIMP_SCALE_ENTRY_SCALE(adj)
|
The GtkAdjustment returned by gimp_scale_entry_new() . |
Returns : |
the scale_entry's GtkHScale. |
#define GIMP_SCALE_ENTRY_SCALE_ADJ(adj)
|
The GtkAdjustment returned by gimp_scale_entry_new() . |
Returns : |
the GtkAdjustment of the scale_entry's GtkHScale. |
#define GIMP_SCALE_ENTRY_SPINBUTTON(adj)
|
The GtkAdjustment returned by gimp_scale_entry_new() . |
Returns : |
the scale_entry's GtkSpinButton. |
#define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj)
|
The GtkAdjustment returned by gimp_scale_entry_new() . |
Returns : |
the GtkAdjustment of the scale_entry's GtkSpinButton. |
GtkObject * gimp_scale_entry_new (GtkTable *table
,gint column
,gint row
,const gchar *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
,const gchar *tooltip
,const gchar *help_id
);
This function creates a GtkLabel, a GtkHScale and a GtkSpinButton and attaches them to a 3-column GtkTable.
|
The GtkTable the widgets will be attached to. |
|
The column to start with. |
|
The row to attach the widgets. |
|
The text for the GtkLabel which will appear left of the GtkHScale. |
|
The minimum horizontal size of the GtkHScale. |
|
The minimum horizontal size of the GtkSpinButton. |
|
The initial value. |
|
The lower boundary. |
|
The upper boundary. |
|
The step increment. |
|
The page increment. |
|
The number of decimal digits. |
|
TRUE if the range of possible values of the
GtkSpinButton should be the same as of the GtkHScale. |
|
The spinbutton's lower boundary
if constrain == FALSE . |
|
The spinbutton's upper boundary
if constrain == FALSE . |
|
A tooltip message for the scale and the spinbutton. |
|
The widgets' help_id (see gimp_help_set_help_data() ). |
Returns : |
The GtkSpinButton's GtkAdjustment. |
void gimp_scale_entry_set_sensitive (GtkObject *adjustment
,gboolean sensitive
);
Sets the sensitivity of the scale_entry's GtkLabel, GtkHScale and GtkSpinButton.
|
a GtkAdjustment returned by gimp_scale_entry_new()
|
|
a boolean value with the same semantics as the sensitive
parameter of gtk_widget_set_sensitive()
|
void gimp_scale_entry_set_logarithmic (GtkObject *adjustment
,gboolean logarithmic
);
Sets whether the scale_entry's scale widget will behave in a linear or logharithmic fashion. Useful when an entry has to attend large ranges, but smaller selections on that range require a finer adjustment.
|
a GtkAdjustment as returned by gimp_scale_entry_new()
|
|
a boolean value to set or reset logarithmic behaviour of the scale widget |
Since GIMP 2.2
gboolean gimp_scale_entry_get_logarithmic (GtkObject *adjustment
);
|
a GtkAdjustment as returned by gimp_scale_entry_new()
|
Returns : |
TRUE if the the entry's scale widget will behave in
logharithmic fashion, FALSE for linear behaviour. |
Since GIMP 2.2
GtkObject * gimp_color_scale_entry_new (GtkTable *table
,gint column
,gint row
,const gchar *text
,gint scale_width
,gint spinbutton_width
,gdouble value
,gdouble lower
,gdouble upper
,gdouble step_increment
,gdouble page_increment
,guint digits
,const gchar *tooltip
,const gchar *help_id
);
This function creates a GtkLabel, a GimpColorScale and a GtkSpinButton and attaches them to a 3-column GtkTable.
|
The GtkTable the widgets will be attached to. |
|
The column to start with. |
|
The row to attach the widgets. |
|
The text for the GtkLabel which will appear left of the GtkHScale. |
|
The minimum horizontal size of the GtkHScale. |
|
The minimum horizontal size of the GtkSpinButton. |
|
The initial value. |
|
The lower boundary. |
|
The upper boundary. |
|
The step increment. |
|
The page increment. |
|
The number of decimal digits. |
|
A tooltip message for the scale and the spinbutton. |
|
The widgets' help_id (see gimp_help_set_help_data() ). |
Returns : |
The GtkSpinButton's GtkAdjustment. |
#define GIMP_RANDOM_SEED_SPINBUTTON(hbox)
|
The GtkHBox returned by gimp_random_seed_new() . |
Returns : |
the random_seed's GtkSpinButton. |
#define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox)
|
The GtkHBox returned by gimp_random_seed_new() . |
Returns : |
the GtkAdjustment of the random_seed's GtkSpinButton. |
#define GIMP_RANDOM_SEED_TOGGLE(hbox)
|
The GtkHBox returned by gimp_random_seed_new() . |
Returns : |
the random_seed's GtkToggleButton. |
GtkWidget * gimp_random_seed_new (guint32 *seed
,gboolean *random_seed
);
Creates a widget that allows the user to control how the random number generator is initialized.
|
A pointer to the variable which stores the random seed. |
|
A pointer to a boolean indicating whether seed should be initialised randomly or not. |
Returns : |
A GtkHBox containing a GtkSpinButton for the seed and a GtkButton for setting a random seed. |
#define GIMP_COORDINATES_CHAINBUTTON(sizeentry)
|
The GimpSizeEntry returned by gimp_coordinates_new() . |
Returns : |
the GimpChainButton which is attached to the GimpSizeEntry. |
GtkWidget * gimp_coordinates_new (GimpUnit unit
,const gchar *unit_format
,gboolean menu_show_pixels
,gboolean menu_show_percent
,gint spinbutton_width
,GimpSizeEntryUpdatePolicy update_policy
,gboolean chainbutton_active
,gboolean chain_constrains_ratio
,const gchar *xlabel
,gdouble x
,gdouble xres
,gdouble lower_boundary_x
,gdouble upper_boundary_x
,gdouble xsize_0
,gdouble xsize_100
,const gchar *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.
|
The initial unit of the GimpUnitMenu. |
|
A printf-like unit-format string as is used with
gimp_unit_menu_new() . |
|
TRUE if the GimpUnitMenu should contain an item
for GIMP_UNIT_PIXEL. |
|
TRUE if the GimpUnitMenu should contain an item
for GIMP_UNIT_PERCENT. |
|
The horizontal size of the GimpSizeEntry's GtkSpinButton's. |
|
The update policy for the GimpSizeEntry. |
|
TRUE if the attached GimpChainButton should be
active. |
|
TRUE if the chainbutton should constrain the
fields' aspect ratio. If FALSE , the values will
be constrained. |
|
The label for the X coordinate. |
|
The initial value of the X coordinate. |
|
The horizontal resolution in DPI. |
|
The lower boundary of the X coordinate. |
|
The upper boundary of the X coordinate. |
|
The X value which will be treated as 0%. |
|
The X value which will be treated as 100%. |
|
The label for the Y coordinate. |
|
The initial value of the Y coordinate. |
|
The vertical resolution in DPI. |
|
The lower boundary of the Y coordinate. |
|
The upper boundary of the Y coordinate. |
|
The Y value which will be treated as 0%. |
|
The Y value which will be treated as 100%. |
Returns : |
The new GimpSizeEntry. |
void gimp_toggle_button_update (GtkWidget *widget
,gpointer data
);
Note that this function calls gimp_toggle_button_sensitive_update()
which is a deprecated hack you shouldn't use. See that function's
documentation for a proper replacement of its functionality.
|
A GtkToggleButton. |
|
A pointer to a gint variable which will store the value of
gtk_toggle_button_get_active() . |
void gimp_radio_button_update (GtkWidget *widget
,gpointer data
);
Note that this function calls gimp_toggle_button_sensitive_update()
which is a deprecated hack you shouldn't use. See that function's
documentation for a proper replacement of its functionality.
|
A GtkRadioButton. |
|
A pointer to a gint variable which will store the value of
GPOINTER_TO_INT (g_object_get_data (widget , "gimp-item-data")). |
void gimp_int_adjustment_update (GtkAdjustment *adjustment
,gpointer data
);
Note that the GtkAdjustment's value (which is a gdouble) will be
rounded with RINT()
.
|
A GtkAdjustment. |
|
A pointer to a gint variable which will store the
adjustment 's value. |
void gimp_uint_adjustment_update (GtkAdjustment *adjustment
,gpointer data
);
Note that the GtkAdjustment's value (which is a gdouble) will be rounded with (guint) (value + 0.5).
|
A GtkAdjustment. |
|
A pointer to a guint variable which will store the
adjustment 's value. |
void gimp_float_adjustment_update (GtkAdjustment *adjustment
,gpointer data
);
|
A GtkAdjustment. |
|
A pointer to a gfloat varaiable which will store the
adjustment 's value. |
void gimp_double_adjustment_update (GtkAdjustment *adjustment
,gpointer data
);
|
A GtkAdjustment. |
|
A pointer to a gdouble variable which will store the
adjustment 's value. |
GtkWidget * gimp_table_attach_aligned (GtkTable *table
,gint column
,gint row
,const gchar *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.
|
The GtkTable the widgets will be attached to. |
|
The column to start with. |
|
The row to attach the widgets. |
|
The text for the GtkLabel which will be attached left of the widget. |
|
The horizontal alignment of the GtkLabel. |
|
The vertival alignment of the GtkLabel. |
|
The GtkWidget to attach right of the label. |
|
The number of columns the widget will use. |
|
TRUE if the widget should be left-aligned. |
Returns : |
The created GtkLabel. |
void gimp_label_set_attributes (GtkLabel *label
,...
);
Sets Pango attributes on a GtkLabel in a more convenient way than
gtk_label_set_attributes()
.
This function is useful if you want to change the font attributes of a GtkLabel. This is an alternative to using PangoMarkup which is slow to parse and akward to handle in an i18n-friendly way.
The attributes are set on the complete label, from start to end. If you need to set attributes on part of the label, you will have to use the PangoAttributes API directly.
|
a GtkLabel |
|
a list of PangoAttrType and value pairs terminated by -1. |
Since GIMP 2.2
#define GIMP_WIDGETS_ERROR (gimp_widgets_error_quark ())
The GIMP widgets error domain.
Since GIMP 2.8
GQuark gimp_widgets_error_quark (void
);
This function is never called directly. Use GIMP_WIDGETS_ERROR()
instead.
Returns : |
the GQuark that defines the GIMP widgets error domain. |