![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|
gwydgetutilsgwydgetutils — |
#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); 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); gboolean gwy_dialog_prevent_delete_cb (void); GtkWidget* gwy_stock_like_button_new (const gchar *label_text, const gchar *stock_id); PangoFontMap* gwy_get_pango_ft2_font_map (gboolean unref); void gwy_gdk_cursor_new_or_ref (GdkCursor **cursor, GdkCursorType type); void gwy_gdk_cursor_free_or_unref (GdkCursor **cursor);
#define gwy_adjustment_get_int(adj)
Gets a properly rounded integer value from an adjustment.
adj : | 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.
table : | A GtkTable. |
row : | Table row to attach to. |
name : | The label before middle_widget. |
units : | The label after adj. |
middle_widget : | 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.
Following object data are set on pivot to various components: "scale", "check", "label", "units", "middle_widget" (some may be NULL if not present).
FIXME: What exactly happens with various style values is quite convoluted.
table : | A GtkTable. |
row : | Row in table to attach stuff to. |
name : | The label before pivot widget. |
units : | The label after pivot widget. |
pivot : | Either a GtkAdjustment, or a widget to use instead of the spin button and scale widgets (if style is GWY_HSCALE_WIDGET). |
style : | 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.
pivot : | The same object that was passed to gwy_table_attach_hscale() as pivot. |
sensitive : | TRUE to make the row sensitive, FALSE to insensitive. |
GtkWidget* gwy_table_get_child_widget (GtkWidget *table, gint row, gint col);
Finds a widget in GtkTable by its coordinates.
By widget at (col, row) is meant a widget that either contains this corner or is attached by its left side, top side, or top left cornder to it.
If there are multiple matches due to overlapping widgets, an arbitrary of them is returned.
table : | A GtkTable. |
row : | Row in table. |
col : | Column in table. |
Returns : | The widget at (col, row) or NULL if there is no such widget. |
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.
Note this function does not return anything, it runs the dialog modally and returns when it finishes.
dialog_title : | Title of the color selection dialog (NULL to use default). |
color_button : | Color button to update on color change (or NULL). |
container : | Container to initialize the color from and save it to. |
prefix : | Prefix in container (normally "/0/mask"). |
gboolean gwy_dialog_prevent_delete_cb (void);
Returns TRUE.
The purpose of this function is to be used as a callback connected to the "delete_event" of non-modal dialogs so that they can hide instead of being destroyed. This is achieved by returning TRUE from the "delete_event" callback.
See GtkDialog source code for the gory details...
Returns : | TRUE. |
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.
label_text : | Button label text (with mnemonic). |
stock_id : | Button icon stock id. |
Returns : | The newly created button as GtkWidget. |
PangoFontMap* gwy_get_pango_ft2_font_map (gboolean unref);
Returns global Pango FT2 font map, eventually creating it.
unref : | If TRUE, function removes the font map reference and returns NULL. |
Returns : | Pango FT2 font map. Add your own reference if you want it to never go away. |
void gwy_gdk_cursor_new_or_ref (GdkCursor **cursor, GdkCursorType type);
Increments reference count of a given Gdk cursor or creates a new one (if cursor is NULL) of type cursor_type.
This function is intended for layer implementation.
cursor : | A Gdk cursor, or NULL. |
type : | Cursor type to eventually create. |
void gwy_gdk_cursor_free_or_unref (GdkCursor **cursor);
Decrements reference count of a Gdk cursor, possibly freeing it.
This function is intended for layer implementation.
cursor : | A Gdk cursor. |
<< gwydgetenums | gwystock >> |