gtk_widget_set_sensitive (dialog->change_button, FALSE);
gtk_widget_set_sensitive (dialog->add_button, TRUE);
}
gtk_widget_set_sensitive (dialog->change_button, FALSE);
gtk_widget_set_sensitive (dialog->add_button, TRUE);
}
g_signal_handler_unblock (GTK_ENTRY (dialog->label_entry),
dialog->change_handler_id);
g_signal_handler_unblock (GTK_ENTRY (dialog->label_entry),
dialog->change_handler_id);
on_cancel (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
val_labs_cancel (dialog);
on_cancel (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
val_labs_cancel (dialog);
static void repopulate_dialog (struct val_labs_dialog *dialog);
/* Callback which occurs when the "Change" button is clicked */
static void repopulate_dialog (struct val_labs_dialog *dialog);
/* Callback which occurs when the "Change" button is clicked */
on_change (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
on_change (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
- text_to_value (val_text, &v,
- dialog->var_store->dict,
- *var_get_write_format (dialog->pv));
+ text_to_value (val_text,
+ dialog->dict,
+ dialog->pv,
+ &v);
val_labs_replace (dialog->labs, &v,
gtk_entry_get_text (GTK_ENTRY (dialog->label_entry)));
val_labs_replace (dialog->labs, &v,
gtk_entry_get_text (GTK_ENTRY (dialog->label_entry)));
on_add (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
on_add (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
- if ( ! val_labs_add (dialog->labs, &v,
- gtk_entry_get_text
- ( GTK_ENTRY (dialog->label_entry)) ) )
- return FALSE;
-
- gtk_widget_set_sensitive (dialog->add_button, FALSE);
+ if (val_labs_add (dialog->labs, &v,
+ gtk_entry_get_text
+ ( GTK_ENTRY (dialog->label_entry)) ) )
+ {
+ gtk_widget_set_sensitive (dialog->add_button, FALSE);
on_remove (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
union value value;
on_remove (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
union value value;
get_selected_tuple (dialog, &value, NULL);
vl = val_labs_lookup (dialog->labs, &value);
get_selected_tuple (dialog, &value, NULL);
vl = val_labs_lookup (dialog->labs, &value);
gtk_widget_grab_focus (dialog->value_entry);
gtk_widget_set_sensitive (dialog->remove_button, FALSE);
gtk_widget_grab_focus (dialog->value_entry);
gtk_widget_set_sensitive (dialog->remove_button, FALSE);
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");
dialog->change_handler_id =
g_signal_connect (dialog->label_entry,
"changed",
dialog->change_handler_id =
g_signal_connect (dialog->label_entry,
"changed",
dialog->value_handler_id =
g_signal_connect (dialog->value_entry,
"changed",
dialog->value_handler_id =
g_signal_connect (dialog->value_entry,
"changed",
vstr, val_lab_get_label (vl));
gtk_list_store_append (list_store, &iter);
vstr, val_lab_get_label (vl));
gtk_list_store_append (list_store, &iter);