Re: How confirm a Button with the RETURN Key not with the mouse



On Mon, Dec 30, 2002 at 05:31:16PM +0100, günther wrote:
I have a very small status window with an OK Button to click an close.
How can I close this window without to click with the mouse to the
button only to use the RETURN key. So the user who takes an input
with the keyboard not has to take the mouse in hand to replay.

The signal you will need is "key-press-event". The callback should look
like this:

gboolean blah(GtkWidget *button, GdkEventKey *event, gpointer data)
{
    if (event->keyval == GDK_Return)
                close_window();

        ...
}

HTH,
        Tilman




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]