Mercurial > pidgin.yaz
changeset 5510:da18a02c3705
[gaim-migrate @ 5909]
Request dialogs now have default buttons.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 25 May 2003 10:06:38 +0000 |
parents | f6ef1871cfcc |
children | d64bbc7ab746 |
files | src/gtkrequest.c |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkrequest.c Sun May 25 09:43:02 2003 +0000 +++ b/src/gtkrequest.c Sun May 25 10:06:38 2003 +0000 @@ -145,10 +145,11 @@ /* Setup the dialog */ gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); + gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), 12); - gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6); /* Setup the main horizontal box */ hbox = gtk_hbox_new(FALSE, 12); @@ -210,6 +211,8 @@ else { entry = gtk_entry_new(); + gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); + gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0); if (default_value != NULL) @@ -268,9 +271,6 @@ data->dialog = dialog = gtk_dialog_new(); for (i = 0; i < action_count; i++) { - gaim_debug(GAIM_DEBUG_MISC, "gtkrequest", - "buttons[2 * %d] = '%s'\n", - i, buttons[2 * i]); gtk_dialog_add_button(GTK_DIALOG(dialog), __text_to_stock(buttons[2 * i]), i); @@ -318,6 +318,9 @@ g_free(label_text); + if (default_action != -1) + gtk_dialog_set_default_response(GTK_DIALOG(dialog), default_action); + /* Show everything. */ gtk_widget_show_all(dialog);