Re: Handle "Enter" pressing at GtkEntry



On Wed, Oct 03, 2012 at 08:19:39PM -0700, Andrew Potter wrote:
On Wed, Oct 3, 2012 at 7:42 AM, Yury Alyaev <mutab0r rambler ru> wrote:
What is the right way to catch "Enter" pressing at the end of the text input
to GtkEntry

gtk_entry_set_activates_default() is probably what you want.

If you actually want what it does.  Usually, I do not want that at all.

I want to recalculate and update something once user has finished
editing the value there (but not during the editing).  This means namely
when the entry loses focus, however, it should be also possible to
invoke the update without leaving the entry, by pressing Enter.  So,
instead of gtk_entry_set_activates_default() I use something like
set-activate-on-unfocus and then just handle activate.

Yeti




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