Re: how do i lose focus from a widget?



On Thu, 2003-05-29 at 11:52, Havoc Pennington wrote:
> On Thu, May 29, 2003 at 11:31:28AM -0400, Paul Davis wrote:
> > how can i get do the opposite of gtk_widget_grab_focus()? i want the
> > toplevel window to have its focus widget unset so that when the mouse
> > re-enters the window, we will not try to assign focus to a widget.
> > 
> > can this be done?
> 
> GTK 1.2 had the mysterious "nothing is focused" state IIRC but it was
> basically a bug; in GTK 2 I'm pretty sure some widget always has
> focus. I don't remember how to get 1.2 into the "nothing is focused"
> state though.

In GTK+-2.x you can get GTK+ into the "nothing focused" state
by:

 gtk_window_set_focus (window, NULL);

It's needed for pathological cases like deleting the focused
widget.

I think it might work with 1.2 as well, even though 
gtk_window_set_focus() was considered an internal function,
it was exported, as I recall.

Regards,
                                  Owen





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