geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

stash-gui-example.c
Go to the documentation of this file.
1gboolean want_handle;
3
4/* Add the stash setting first so we can load it from disk if we want.
5 * Effectively, stash_group_add_boolean() is called for you.
6 * We need to use either a widget pointer or a widget name, and as we
7 * haven't created the widget yet we'll use a name - check_handle. */
8stash_group_add_toggle_button(group, &want_handle, "handle", TRUE, "check_handle");
9
10/* here we could load the setting from disk */
11
12...
13/* Later we create a dialog holding the toggle button widget.
14 * (Note: a check button is a subclass of a toggle button). */
15GtkWidget *dialog = ...;
16GtkWidget *check_button = gtk_check_button_new_with_label(_("Handle"));
17
18/* pack the widget into the dialog */
19gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button);
20
21/* Now we set a name to lookup the widget from the dialog.
22 * We must remember to pass 'dialog' as an argument to Stash later. */
24
25...
26/* At some point we want to display the dialog.
27 * First we apply the want_handle boolean variable to the widget */
28stash_group_display(group, dialog);
29
30/* now display the dialog */
32
33/* let the user manipulate widgets */
34...
35/* Now synchronize the want_handle variable */
36stash_group_update(group, dialog);
GtkWidget * dialog
GtkWidget * check_button
stash_group_add_toggle_button(group, &want_handle, "handle", TRUE, "check_handle")
gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button)
ui_hookup_widget(dialog, check_button, "check_handle")
gtk_widget_show_all(dialog)
StashGroup * group
gboolean want_handle
#define _(String)
Definition: support.h:42