![]() | ![]() | ![]() | Gwyddion Widgets Library Reference Manual | ![]() |
---|
gwydgets — Miscellaneous utility functions
void gwy_widgets_type_init (void); gboolean gwy_widgets_gl_init (void); GdkGLConfig* gwy_widgets_get_gl_config (void); 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); void gwy_color_selector_for_mask (const gchar *dialog_title, GwyDataView *data_view, 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);
Gwyddion classes has to be initialized before they can be safely deserialized. The function gwy_type_init() performs this initialization.
Before 3D widgets (Gwy3DView) can be used, OpenGL must be initialized with gwy_widgets_gl_init().
void gwy_widgets_type_init (void);
Initializes libgwywidgets data types, making their deserialization safe.
Eventually calls gwy_draw_type_init().
Since 1.4.
gboolean gwy_widgets_gl_init (void);
Configures an OpenGL-capable visual for 3D widgets.
Use gwy_widgets_get_gl_config() to get the framebuffer configuration.
This function must be called before OpenGL widgets can be used.
Returns : | TRUE if an appropriate visual was found. |
Since 1.5
GdkGLConfig* gwy_widgets_get_gl_config (void);
Returns OpenGL framebuffer configuration for 3D widgets.
Call gwy_widgets_gl_init() first.
Returns : | The OpenGL framebuffer configuration. |
Since 1.5
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.
table : | A GtkTable. |
row : | Table row to attach to. |
name : | The label before adj. |
units : | The label after adj. |
adj : | An adjustment to create spinbutton from. |
Returns : | The spinbutton as a GtkWidget. |
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. |
void gwy_color_selector_for_mask (const gchar *dialog_title, GwyDataView *data_view, 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). |
data_view : | Data view to update on color change (NULL to not update any data view). |
color_button : | Color button to update on color change (or NULL). |
container : | Container to initialize the color from and save it to, may be NULL to use data_view's one if that is not NULL. |
prefix : | Prefix in container (normally "/0/mask"). |
Since 1.3.
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. |
stock_id : | Button icon stock id. |
Returns : | The newly created button as GtkWidget. |
Since 1.5.
<< gwystock | gwyoptionmenus >> |