Handling the Return key
- From: William Ramsay <ramsayw1 comcast net>
- To: gtk-list gnome org
- Subject: Handling the Return key
- Date: Fri, 24 Aug 2007 17:27:00 -0400
Hi,
Can anyone explain to me how to go about handling the pressing of the
return key
in a data entry dialog? For instance, when the user is done entering
data, pressing
the Enter button on the keyboard should fire the OK button on the dialog.
I can capture the "click" event easily enough. And I can capture the
"key_press_event"
and check to make sure it's a Return key, but how do I connect the two
events to
the same GTK_RESPONSE_OK result? The "click" event is established when
I set up the button (i.e. with gtk_dialog_add_button). But the key
press is
established with g_signal_connect, which sends control to a handler. If
you're in
a loop checking the user input, you can't easily go off to a separate
handler.
There must be a simple way of doing this, but I have yet to figure it out.
Bill
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]