Re: How does the dialog's default button respond "enter" key



2009/10/7 Simon Chan <simon780 gmail com>:
I think you should connect the "enter" signal to the window instead of
the button.
I think what you mean is, you wanna destroy the dialog whenever the
user press "enter" key, right?

Actually I think this is better.  Closing a dialog using the default
button is named "using the default response". There are several steps
to achieve this:

First you need to set the default response for your dialog with
gtk_dialog_set_default_response

Then, you need to set your GtkEntry to activate the default response
when they are activated with:
gtk_entry_set_activates_default

Unfortunately, there seems to be no way to do the same on GtkTreeView.
You will have to connect to the "row-activated" signal and manually
return a response in the handler with
gtk_dialog_response.

Pierre-Luc Beaudoin



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