Re: Do something clever on a keypress with Gtk2-0.92?



On Thursday, August 7, 2003, at 05:41  PM, Tom Cross wrote:

## if the user hits enter (65293) or F10 (65479), run the search
        if (($event->keyval == 65293) || ($event->keyval == 65479))

naughty, naughty! use Gtk2::Gdk::Keysyms for symbolic names, never the raw numbers. that file is generated from your headers at install time.


now, for a search you probably have an Entry. there's a method you can use on an entry to make pressing Enter in the entry activate the default button in a dialog (the button that would be activated if you just pressed enter in the dialog). $entry->activate_default (1), i believe. would this solve your problem?




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