g_signal_connect (G_OBJECT (bw->add), "clicked",
G_CALLBACK (add_cb), bw);
- vbox = gtk_vbox_new (FALSE, 6);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+ vbox = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6);
g_signal_connect (G_OBJECT (bw->delete), "clicked",
G_CALLBACK (delete_cb), bw);
- vbox = gtk_vbox_new (FALSE, 6);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+ vbox = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
create_adding_section (&bw));
- vbox = gtk_vbox_new (FALSE, 6);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+ vbox = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
hbox = gtk_hbox_new (FALSE, 6);
bw.status = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (hbox), bw.status, FALSE, FALSE, 6);
}
GtkWidget *
-create_command_list (GtkTooltips *tip, MSymbol lang, MSymbol name)
+create_command_list (MSymbol lang, MSymbol name)
{
GtkListStore *store;
GtkWidget *view;
}
}
-extern GtkWidget *create_variable_list (GtkTooltips *tip, MSymbol lang,
- MSymbol name);
-extern GtkWidget *create_command_list (GtkTooltips *tip, MSymbol lang,
- MSymbol name);
+extern GtkWidget *create_variable_list (MSymbol lang, MSymbol name);
+extern GtkWidget *create_command_list (MSymbol lang, MSymbol name);
static void
edit_im (GtkTreeView *tree, MSymbol lang, MSymbol name)
{
GtkWidget *dialog, *notebook, *scrolled, *vbox, *label;
- GtkTooltips *tip = gtk_tooltips_new ();
gint response;
MPlist *plist;
NULL));
gtk_widget_set_size_request (dialog, 500, 300);
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER(vbox), 10);
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
+
notebook = gtk_notebook_new ();
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), notebook);
+ gtk_container_add (GTK_CONTAINER (vbox), notebook);
/* Variables' page */
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled),
vbox);
gtk_box_pack_start (GTK_BOX (vbox),
- create_variable_list (tip, lang, name),
+ create_variable_list (lang, name),
FALSE, FALSE, 0);
/* Commands' pages */
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled),
vbox);
gtk_box_pack_start (GTK_BOX (vbox),
- create_command_list (tip, lang, name),
+ create_command_list (lang, name),
FALSE, FALSE, 0);
gtk_widget_show_all (dialog);
update_status (ci);
}
-static gboolean
+static void
config_with_spin (struct ControllerInfo *ci)
{
+ MPlist *plist = mplist ();
gint i;
- gdouble min, max;
i = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (ci->widget));
- gtk_spin_button_get_range (GTK_SPIN_BUTTON (ci->widget), &min, &max);
- if ((gint) min < i && i < (gint) max)
- {
- MPlist *plist = mplist ();
-
- mplist_add (plist, Minteger, (void *) i);
- CONFIG_VARIABLE (plist);
- m17n_object_unref (plist);
- return TRUE;
- }
- else
- {
- GtkWidget *msg;
-
- msg = gtk_message_dialog_new (GTK_WINDOW
- (gtk_widget_get_toplevel (ci->widget)),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- _("The value is out of range (%d - %d)."),
- (gint) min, (gint) max);
- gtk_dialog_run (GTK_DIALOG (msg));
- gtk_widget_destroy (msg);
- update_status (ci);
- return FALSE;
- }
+ mplist_add (plist, Minteger, (void *) i);
+ CONFIG_VARIABLE (plist);
+ m17n_object_unref (plist);
}
static void *
else /* ci->wtype == SPIN_BUTTON */
{
- if (config_with_spin (ci))
- gtk_dialog_response (GTK_DIALOG (ci->dialog), GTK_RESPONSE_OK);
- else
- update_status (ci);
+ config_with_spin (ci);
+ gtk_dialog_response (GTK_DIALOG (ci->dialog), GTK_RESPONSE_OK);
}
}
else /* default or customized */
update_status (ci);
}
-static gboolean
-key_pressed_cb (GtkEntry *entry, GdkEventKey *event, gpointer data)
+static void
+changed_cb (GtkEntry *entry, gpointer data)
{
struct ControllerInfo *ci = data;
gtk_widget_set_sensitive (ci->default_, TRUE);
gtk_widget_set_sensitive (ci->revert, TRUE);
gtk_label_set_text (GTK_LABEL (ci->status), _("Status : modified"));
- return FALSE;
}
static gboolean
else
{
ci->widget = gtk_entry_new ();
- g_signal_connect (GTK_OBJECT (ci->widget), "key-press-event",
- G_CALLBACK (key_pressed_cb), ci);
+ g_signal_connect (GTK_OBJECT (ci->widget), "changed",
+ G_CALLBACK (changed_cb), ci);
ci->wtype = ENTRY_WIDGET;
gtk_entry_set_text (GTK_ENTRY (ci->widget), msymbol_name (value));
gtk_editable_set_editable (GTK_EDITABLE (ci->widget), TRUE);
else
{
ci->widget = gtk_entry_new ();
- g_signal_connect (GTK_OBJECT (ci->widget), "key-press-event",
- G_CALLBACK (key_pressed_cb), ci);
+ g_signal_connect (GTK_OBJECT (ci->widget), "changed",
+ G_CALLBACK (changed_cb), ci);
ci->wtype = ENTRY_WIDGET;
/* Fixme : Assuming the return value is in UTF-8 */
gtk_entry_set_text (GTK_ENTRY (ci->widget),
ci->widget = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 0, 0);
g_signal_connect (GTK_OBJECT (ci->widget), "value-changed",
G_CALLBACK (value_changed_cb), ci);
- g_signal_connect (GTK_OBJECT (ci->widget), "key-press-event",
- G_CALLBACK (key_pressed_cb), ci);
+ g_signal_connect (GTK_OBJECT (ci->widget), "changed",
+ G_CALLBACK (changed_cb), ci);
ci->wtype = SPIN_BUTTON_WIDGET;
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (ci->widget), TRUE);
gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (ci->widget),
- GTK_UPDATE_IF_VALID);
+ GTK_UPDATE_ALWAYS);
}
else
{
gchar buf[32];
ci->widget = gtk_entry_new ();
- g_signal_connect (GTK_OBJECT (ci->widget), "key-press-event",
- G_CALLBACK (key_pressed_cb), ci);
+ g_signal_connect (GTK_OBJECT (ci->widget), "changed",
+ G_CALLBACK (changed_cb), ci);
ci->wtype = ENTRY_WIDGET;
g_snprintf (buf, sizeof (buf), "%d", (gint) value);
gtk_entry_set_text (GTK_ENTRY (ci->widget), buf);
G_CALLBACK (ok_cb), &ci);
vbox = gtk_vbox_new (FALSE, 12);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (ci.dialog)->vbox), vbox);
gtk_container_add (GTK_CONTAINER (vbox), create_widget (&ci));
}
GtkWidget *
-create_variable_list (GtkTooltips *tip, MSymbol lang, MSymbol name)
+create_variable_list (MSymbol lang, MSymbol name)
{
GtkListStore *store;
GtkWidget *view;