X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fdialog-common.c;h=416be46f443389adeaf6cac2ede7ceb4f74426b4;hb=4ad4b27b32995ab6d61167029b66c80411c25962;hp=7edbbe504920a594e22bba139dba576f9e45b213;hpb=fd0c595927a23ea0373551a1eed4570388ea0fc5;p=pspp diff --git a/src/ui/gui/dialog-common.c b/src/ui/gui/dialog-common.c index 7edbbe5049..416be46f44 100644 --- a/src/ui/gui/dialog-common.c +++ b/src/ui/gui/dialog-common.c @@ -23,34 +23,6 @@ #include "helper.h" -/* A (*GtkTreeCellDataFunc) function. - This function expects TREEMODEL to hold G_TYPE_BOXED, which is a pointer to a variable. - It renders the name of the variable into CELL. -*/ -void -XXX_cell_var_name (GtkTreeViewColumn *tree_column, - GtkCellRenderer *cell, - GtkTreeModel *treemodel, - GtkTreeIter *iter, - gpointer data) -{ - const struct variable *var; - GValue value = {0}; - - GtkTreePath *path = gtk_tree_model_get_path (treemodel, iter); - - gtk_tree_model_get_value (treemodel, iter, 0, &value); - - gtk_tree_path_free (path); - - var = g_value_get_boxed (&value); - - g_value_unset (&value); - - g_object_set (cell, "text", var_get_name (var), NULL); -} - - /* Returns FALSE if the variables represented by the union of the rows currently selected by SOURCE widget, and contents of the DEST @@ -193,3 +165,28 @@ numeric_only (GtkWidget *source, GtkWidget *dest) return retval; } +/* + A pair of functions intended to be used as callbacks for the "toggled" signal + of a GtkToggleButton widget. They make the sensitivity of W follow the status + of the togglebutton. +*/ +void +set_sensitivity_from_toggle (GtkToggleButton *togglebutton, GtkWidget *w) +{ + gboolean active = gtk_toggle_button_get_active (togglebutton); + + gtk_widget_set_sensitive (w, active); +} + +/* */ +void +set_sensitivity_from_toggle_invert (GtkToggleButton *togglebutton, + GtkWidget *w) +{ + gboolean active = gtk_toggle_button_get_active (togglebutton); + + gtk_widget_set_sensitive (w, !active); +} + + +