GTK+ utilities

GTK+ utilities — Assorted macros and backward compatible fallbacks

Synopsis

#define             ADG_GTK_MODIFIERS
void                adg_gtk_toggle_button_sensitivize   (GtkToggleButton *toggle_button,
                                                         GtkWidget *widget);
void                adg_gtk_window_hide_here            (GtkWindow *window);
GdkWindow *         gtk_widget_get_window               (GtkWidget *widget);

Description

Collection of macros and functions that do not fit inside any other topic.

Details

ADG_GTK_MODIFIERS

#define ADG_GTK_MODIFIERS  (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)

A GDK mask of the key/mouse modifiers accepted by the GTK+ widgets of the ADG library. This means the state of the specified modifiers is always checked: for example GDK_CONTROL_MASK and GDK_SHIFT_MASK are included, hence keeping CTRL and SHIFT pressed is different from keeping only SHIFT pressed. GDK_LOCK_MASK instead is not considered, so having it enabled or disabled does not make any difference while monitoring the status SHIFT or CTRL.

Since 1.0


adg_gtk_toggle_button_sensitivize ()

void                adg_gtk_toggle_button_sensitivize   (GtkToggleButton *toggle_button,
                                                         GtkWidget *widget);

Assigns the value of the "active" property of toggle_button to the "sensitive" property of widget. Useful to set or reset the sensitiveness of widget depending of the state of a check button, for example:

g_signal_connect(toggle_button, "toggled",
                 G_CALLBACK(adg_gtk_toggle_button_sensitivize), widget1);
g_signal_connect(toggle_button, "toggled",
                 G_CALLBACK(adg_gtk_toggle_button_sensitivize), widget2);
g_signal_connect(toggle_button, "toggled",
                 G_CALLBACK(adg_gtk_toggle_button_sensitivize), widget3);

toggle_button :

a GtkToggleButton

widget :

the GtkWidget

Since 1.0


adg_gtk_window_hide_here ()

void                adg_gtk_window_hide_here            (GtkWindow *window);

A convenient function that hides window and tries to store the current position. Any subsequent call to gtk_widget_show() will hopefully reopen the window at the same position.

It can be used instead of gtk_widget_hide() or by connecting it to a "response" signal, for instance:

g_signal_connect(dialog, "response",
                 G_CALLBACK(adg_gtk_window_hide_here), NULL);

window :

a GtkWindow

Since 1.0


gtk_widget_get_window ()

GdkWindow *         gtk_widget_get_window               (GtkWidget *widget);

Returns the widget's window if it is realized, NULL otherwise. This is an API fallback for GTK+ prior to 2.14.

widget :

a GtkWidget

Returns :

widget's window.

Since 1.0