Re: Checking for window inactivity



Unfortunately I think that when the popup menu appears, focus switches
to it automatically, and so the window really *has* lost focus.

Easiest solution I can see is to examine all the children
(recursively) of the window that has "lost" focus, and check to see if
any of them has focus.  You can do this using gtk_container_forall()
or gtk_container_foreach() (probably the latter is more approrpiate
here).  Perhaps GTK has some functionality that will check this sort
of thing for you, but I couldn't find it.

There's a gtk_window_has_toplevel_focus() which seems to me to be
intuitively what you'd want, but it seems to always report exactly the
opposite of what I'd expect.  Hmm.

-Adam



On 6/5/05, Luke McOmber <lmcomber rochester rr com> wrote:
Hey everyone,

I have hopefully a simple question. I have a window that contains a
textview in it. I want to change the background color of the textview
whenever the window becomes inactive, i.e. whenever the title bar
becomes grayed out.

I tried using the "focus-out-event" on the window along with
gtk_window_is_active(). But that changes the background color even when
you right click on the textview.

How can I truly tell when the window becomes inactive?

TIA,
Luke


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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