RE: [gtk-list] keypress events in text widget




> Anyway, I am using a text widget in my application.  When I run it,
> the very first time I want to enter text in the widget I have to
> do a button click in the window.  After that, focus seems to follow
> the mouse properly -- if I move the pointer over the window, I'm able
> to enter text.  So....  does anybody have any idea why this is
> happening?  And better, how to fix it?

The keyboard focus is probably initially set to another widget in the
window (e.g. a button or something). (Move the mouse over the window
and try pressing the cursor keys - most widgets display a thin black
border around them when they have the keyboard focus.)

If you want the keyboard focus going straight to the entry I think
you can do this:

  gtk_widget_grab_focus(entry);


Damon




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