Re: Enabling return for dialog with focus on gtk_entry
- From: Manu TM <manutm007 gmail com>
- To: Frank Lanitz <frank frank uvena de>, GTK mailing list <gtk-app-devel-list gnome org>
- Subject: Re: Enabling return for dialog with focus on gtk_entry
- Date: Sat, 13 Mar 2010 17:23:44 +0100
I made something similar, some times ago, sending GTK_RESPONSE_OK:
static gint enter_key_pressed_in_entry(GtkWidget *widget, GdkEventKey
*event, gpointer unused)
{
widget = widget;
event = event;
unused = unused;
gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
return TRUE;
}
your_dialog_or_whatever()
{
/* ... */
entry = gtk_entry_new();
g_signal_connect(G_OBJECT(entry), "activate",
G_CALLBACK(enter_key_pressed_in_entry), NULL);
/* ... */
}
Emmanuel Thomas-Maurin
Frank Lanitz wrote:
Hi list,
I'm not sure whether you can help me here out. I'm looking for a way to
directly send GTK_RESPONSE_ACCEPT by hitting return, even on
dialogs where a GTK Entry or a ComboBox is having the focus. Do you
might have an idea how to do this or some code snippet I can have a
look at?
Thanks,
Frank
------------------------------------------------------------------------
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]