Re: Space Bar Issue



On Thu, 2006-05-18 at 22:00 +0200, Patrick Jacquot wrote:
Le jeudi 18 mai 2006 Ã 11:50 -0700, developer a Ãcrit :
Hi List,

On the app I am making, when I press the space bar,
it is treated as a left mouse click on any one of
the gtk2 buttons on the screen at the time, and
even a click on a gtk2 button that used to be on
the screen.

That's the customary behaviour of all the GTK apps I know:
one can simulate a click on the button who has the focus
by hitting the space bar.

That's not just GTK behaviour, it's standard in pretty much any
mainstream GUI toolkit including MS Windows and MacOS.

It sounds like the problem may simply be that the app in question is not
setting a sensible default for which widget gets the input focus when
the window is displayed.

If you're building your form with Glade then you can toggle the 'Has
Focus' button on the 'Common' tag to 'Yes' for the widget that should
get the focus when the form is displayed.

If you're not using Glade then you can call the 'grab_focus' method on
the widget that you want to get the keyboard input.  eg:

  $text_view->grab_focus;

Cheers
Grant




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