![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <libgwydgets/gwydgets.h> #define gwy_adjustment_get_int (adj) GtkWidget * gwy_table_attach_spinbutton (GtkWidget *table
,gint row
,const gchar *name
,const gchar *units
,GtkObject *adj
); void gwy_table_attach_row (GtkWidget *table
,gint row
,const gchar *name
,const gchar *units
,GtkWidget *middle_widget
); GtkWidget * gwy_table_attach_hscale (GtkWidget *table
,gint row
,const gchar *name
,const gchar *units
,GtkObject *pivot
,GwyHScaleStyle style
); void gwy_table_hscale_set_sensitive (GtkObject *pivot
,gboolean sensitive
); #define gwy_table_hscale_get_scale (pivot) #define gwy_table_hscale_get_check (pivot) #define gwy_table_hscale_get_label (pivot) #define gwy_table_hscale_get_units (pivot) #define gwy_table_hscale_get_middle_widget (pivot) GtkWidget * gwy_table_get_child_widget (GtkWidget *table
,gint row
,gint col
); void gwy_color_selector_for_mask (const gchar *dialog_title
,GwyColorButton *color_button
,GwyContainer *container
,const gchar *prefix
); void gwy_mask_color_selector_run (const gchar *dialog_title
,GtkWindow *parent
,GwyColorButton *color_button
,GwyContainer *container
,const gchar *prefix
); void gwy_list_store_row_changed (GtkListStore *store
,GtkTreeIter *iter
,GtkTreePath *path
,gint row
); gboolean gwy_dialog_prevent_delete_cb (void
); GtkWidget * gwy_label_new_header (const gchar *text
); GtkWidget * gwy_stock_like_button_new (const gchar *label_text
,const gchar *stock_id
); GtkWidget * gwy_tool_like_button_new (const gchar *label_text
,const gchar *stock_id
); gboolean gwy_widget_get_activate_on_unfocus (GtkWidget *widget
); void gwy_widget_set_activate_on_unfocus (GtkWidget *widget
,gboolean activate
); void gwy_widget_sync_sensitivity (GtkWidget *master
,GtkWidget *slave
); PangoFontMap * gwy_get_pango_ft2_font_map (gboolean unref
);
#define gwy_adjustment_get_int(adj)
Gets a properly rounded integer value from an adjustment, cast to gint.
|
A GtkAdjustment to get value of. |
GtkWidget * gwy_table_attach_spinbutton (GtkWidget *table
,gint row
,const gchar *name
,const gchar *units
,GtkObject *adj
);
Attaches a spinbutton with two labels to a table.
void gwy_table_attach_row (GtkWidget *table
,gint row
,const gchar *name
,const gchar *units
,GtkWidget *middle_widget
);
Attaches a widget with two labels to a table.
|
A GtkTable. |
|
Table row to attach to. |
|
The label before middle_widget . |
|
The label after adj . |
|
A widget. |
GtkWidget * gwy_table_attach_hscale (GtkWidget *table
,gint row
,const gchar *name
,const gchar *units
,GtkObject *pivot
,GwyHScaleStyle style
);
Attaches a spinbutton with a scale and labels, or something else to a table row.
You can use functions gwy_table_hscale_get_scale()
,
gwy_table_hscale_get_check()
, etc. to get the various widgets from pivot
later.
FIXME: What exactly happens with various style
values is quite convoluted.
|
A GtkTable. |
|
Row in table to attach stuff to. |
|
The label before pivot widget. |
|
The label after pivot widget. |
|
Either a GtkAdjustment, or a widget to use instead of the spin
button and scale widgets (if style is GWY_HSCALE_WIDGET ). |
|
A mix of options an flags determining what and how will be attached to the table. |
Returns : |
The middle widget. If a spinbutton is attached, then this
spinbutton is returned. Otherwise (in GWY_HSCALE_WIDGET case)
pivot itself. |
void gwy_table_hscale_set_sensitive (GtkObject *pivot
,gboolean sensitive
);
Sets sensitivity of a group of controls create by gwy_table_attach_hscale()
.
Do not use with GWY_HSCALE_CHECK
, simply set state of the check button
in such a case.
This function can be used with rows created by gwy_table_attach_spinbutton()
too if the spinbutton is passed as pivot
.
|
The same object that was passed to gwy_table_attach_hscale() as
pivot . |
|
TRUE to make the row sensitive, FALSE to insensitive. |
#define gwy_table_hscale_get_scale(pivot)
Gets the horizontal scale associated with a pivot object.
May return NULL
if constructed with GWY_HSCALE_NO_SCALE
,
GWY_HSCALE_WIDGET
, or GWY_HSCALE_WIDGET_NO_EXPAND
.
|
Pivot object passed to gwy_table_attach_hscale() . |
#define gwy_table_hscale_get_check(pivot)
Gets the check button associated with a pivot object.
May return NULL
if not constructed with GWY_HSCALE_CHECK
.
|
Pivot object passed to gwy_table_attach_hscale() . |
#define gwy_table_hscale_get_label(pivot)
Gets the (left) label associated with a pivot object.
May return NULL
if constructed with GWY_HSCALE_CHECK
.
|
Pivot object passed to gwy_table_attach_hscale() . |
#define gwy_table_hscale_get_units(pivot)
Gets the units label associated with a pivot object.
May return NULL
if constructed without units.
|
Pivot object passed to gwy_table_attach_hscale() . |
#define gwy_table_hscale_get_middle_widget(pivot)
Gets the middle widget associated with a pivot object.
|
Pivot object passed to gwy_table_attach_hscale() . |
GtkWidget * gwy_table_get_child_widget (GtkWidget *table
,gint row
,gint col
);
Finds a widget in GtkTable by its coordinates.
Coordinates (col
, row
) are taken as coordinates of widget top left corner.
More precisely, the returned widget either contains the specified grid
point or it is attached by its left side, top side, or top left corner to
this point.
If there are multiple matches due to overlapping widgets, a random match is returned.
void gwy_color_selector_for_mask (const gchar *dialog_title
,GwyColorButton *color_button
,GwyContainer *container
,const gchar *prefix
);
Creates and runs a color selector dialog for a mask.
See gwy_mask_color_selector_run()
for details.
void gwy_mask_color_selector_run (const gchar *dialog_title
,GtkWindow *parent
,GwyColorButton *color_button
,GwyContainer *container
,const gchar *prefix
);
Creates and runs a color selector dialog for a mask.
Note this function does not return anything, it runs the color selection dialog modally and returns when it is finished.
|
Title of the color selection dialog (NULL to use default). |
|
Dialog parent window. The color selector dialog will be made transient for this window. |
|
Color button to update on color change (or NULL ). |
|
Container to initialize the color from and save it to. |
|
Prefix in container (normally "/0/mask"). |
Since 2.1
void gwy_list_store_row_changed (GtkListStore *store
,GtkTreeIter *iter
,GtkTreePath *path
,gint row
);
Convenience function to emit "GtkTreeModel::row-changed" signal on a tree store.
At least one of iter
, path
, row
must be set to identify the row to emit
"row-changed" on, and usually exactly one should be set. The remaining
information necessary to call gtk_tree_model_row_changed()
is inferred
automatically.
The behaviour of this function is undefined for specified, but inconsistent
iter
, path
, and row
.
gboolean gwy_dialog_prevent_delete_cb (void
);
gwy_dialog_prevent_delete_cb
is deprecated and should not be used in newly-written code.
Returns TRUE
.
Use gtk_true()
instead.
Returns : |
TRUE . |
GtkWidget * gwy_label_new_header (const gchar *text
);
Creates a bold, left aligned label.
The purpose of this function is to avoid propagation of too much markup to translations (and to reduce code clutter by avoiding dummy constructor and left-aligning automatically).
|
Text to put into the label. It must be a valid markup and it will be made bold by adding appropriate markup around it. |
Returns : |
A newly created GtkLabel. |
GtkWidget * gwy_stock_like_button_new (const gchar *label_text
,const gchar *stock_id
);
Creates a button that looks like a stock button, but can have different label text.
|
Button label text (with mnemonic). |
|
Button icon stock id. |
Returns : |
The newly created button as GtkWidget. |
GtkWidget * gwy_tool_like_button_new (const gchar *label_text
,const gchar *stock_id
);
Creates a button that looks like a tool button, but can have different label text.
|
Button label text (with mnemonic). |
|
Button icon stock id. |
Returns : |
The newly created button as GtkWidget. |
gboolean gwy_widget_get_activate_on_unfocus (GtkWidget *widget
);
Obtains the activate-on-unfocus state of a widget.
|
A widget. |
Returns : |
TRUE if signal "GtkWidget::activate" is emitted when focus leaves
the widget. |
Since 2.5
void gwy_widget_set_activate_on_unfocus (GtkWidget *widget
,gboolean activate
);
Sets the activate-on-unfocus state of a widget.
When it is enabled, signal "GtkWidget::activate" is emited whenever focus leaves the widget.
Since 2.5
void gwy_widget_sync_sensitivity (GtkWidget *master
,GtkWidget *slave
);
Make widget's sensitivity follow the sensitivity of another widget.
The sensitivity of slave
is set according to master
's effective
sensitivity (as returned by GTK_WIDGET_IS_SENSITIVE()
), i.e. it does not
just synchronize GtkWidget:sensitive property.
|
Master widget. |
|
Slave widget. |
Since 2.8
PangoFontMap * gwy_get_pango_ft2_font_map (gboolean unref
);
gwy_get_pango_ft2_font_map
is deprecated and should not be used in newly-written code.
Returns global Pango FT2 font map, eventually creating it.
FT2 portability to Win32 is questionable, use PangoCairo instead.