Re: [gtk-list] Re: Remaining Q's




On Sun, 2 May 1999, pavel wrote:
> OK, I'll simplify my further. Now I'm beginning to think that *only a
> window* can capture a "key_pressed_event". It cannot be a particular
> widget within window (for instance, the one that has the mouse pointer
> over it). Is this correct?
> 

Only windows get key press events from Gdk; they check whether the key
event matches a menu accelerator or some other magic key understood by
Gtk; if not, they forward the event to the "focus widget" within the
window. Only widgets with the GTK_CAN_FOCUS flag set can be the focus
widget; you can move between focus widgets with the Tab or arrow keys.
Normally the focus widget has a little black border drawn around it.

Most likely the preview widget never gets the focus. You will probably
need to write a subclass of it that implements the focus in, focus out,
and draw focus class functions if you want it to get key events. Then when
the user focuses the preview they will be able to type at it.

However based on all these questions it sounds like you are bending the
preview widget into a bunch of contortions. Maybe you are using the wrong
widget for your goals.

Havoc




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