summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-01-02 20:28:20 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-01-02 20:28:20 +0100
commitf4ccff8a434c832be406b6bde08d94cf26b31fdc (patch)
treef65d0050eed2dddb1f40776a28d8c1a50382b829
parentf4e78b03800068498ab72b24f54d9d2c2ab71201 (diff)
Add default response to the text input dialog.
-rw-r--r--text_input_dialog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/text_input_dialog.c b/text_input_dialog.c
index da18b24..8a77692 100644
--- a/text_input_dialog.c
+++ b/text_input_dialog.c
@@ -7,7 +7,10 @@ GtkDialog *text_input_dialog_new(GtkWidget *parent, const gchar *msg) {
dialog = gtk_message_dialog_new(GTK_WINDOW(parent), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, msg);
+ gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+
entry = gtk_entry_new();
+ gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
gtk_box_pack_end(GTK_BOX(vbox), entry, FALSE, FALSE, 0);