Hook up the 'activate' signal on the entry dialog. Fixes Debian bug
2003-09-11 Glynn Foster <glynn.foster@sun.com> * src/entry.c: Hook up the 'activate' signal on the entry dialog. Fixes Debian bug #202332.
This commit is contained in:
parent
0ebb6d692b
commit
ceb065ee33
22
src/entry.c
22
src/entry.c
@ -26,6 +26,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static void zenity_entry_dialog_response (GtkWidget *widget, int response, gpointer data);
|
static void zenity_entry_dialog_response (GtkWidget *widget, int response, gpointer data);
|
||||||
|
static void zenity_entry_response (GtkWidget *widget, gpointer data);
|
||||||
|
|
||||||
static GtkWidget *entry;
|
static GtkWidget *entry;
|
||||||
|
|
||||||
@ -68,6 +69,9 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
|
|||||||
|
|
||||||
entry = glade_xml_get_widget (glade_dialog, "zenity_entry_input");
|
entry = glade_xml_get_widget (glade_dialog, "zenity_entry_input");
|
||||||
|
|
||||||
|
g_signal_connect (G_OBJECT (entry), "activate",
|
||||||
|
G_CALLBACK (zenity_entry_response), data);
|
||||||
|
|
||||||
if (glade_dialog)
|
if (glade_dialog)
|
||||||
g_object_unref (glade_dialog);
|
g_object_unref (glade_dialog);
|
||||||
|
|
||||||
@ -83,6 +87,22 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
|
|||||||
gtk_main ();
|
gtk_main ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
zenity_entry_response (GtkWidget *widget, gpointer data)
|
||||||
|
{
|
||||||
|
ZenityData *zen_data = data;
|
||||||
|
const gchar *text;
|
||||||
|
|
||||||
|
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
|
||||||
|
|
||||||
|
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||||
|
|
||||||
|
if (text != NULL)
|
||||||
|
g_print ("%s\n", text);
|
||||||
|
|
||||||
|
gtk_main_quit ();
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
zenity_entry_dialog_response (GtkWidget *widget, int response, gpointer data)
|
zenity_entry_dialog_response (GtkWidget *widget, int response, gpointer data)
|
||||||
{
|
{
|
||||||
@ -95,7 +115,7 @@ zenity_entry_dialog_response (GtkWidget *widget, int response, gpointer data)
|
|||||||
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||||
|
|
||||||
if (text != NULL)
|
if (text != NULL)
|
||||||
g_print ("%s\n", gtk_entry_get_text (GTK_ENTRY (entry)));
|
g_print ("%s\n", text);
|
||||||
|
|
||||||
gtk_main_quit ();
|
gtk_main_quit ();
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user