[pygtk] Taking action when a window is raised

Tony Nelson tonynelson at georgeanelson.com
Thu Mar 9 11:13:37 WST 2006


At 2:10 PM -0500 3/8/06, Graham Ashton wrote:
>[I'm re-posting this from http://www.gnomedev.com/viewtopic.php?t=36]
>
>Hi there. I'm trying to work out how to run a callback when my
>application's main window is given top level focus. I'm using PyGTK,
>but I think my question is really a general GTK+ one.
>
>How are you supposed to do it? I can't find a signal on a GtkWindow
>that I could connect to, which has left me stumped. I'm not sure how
>else it would work.
>
>I know it's possible (the wonderful gossip
>[http://live.gnome.org/Gossip] does it), but a cursory scan of the
>source didn't reveal anything obvious (to me).
>
>Any pointers?

My guess is a GDK_FOCUS_CHANGE event.  I connected an "event" callback to
my main window and that's what seemed pertinent when I changed the
frontmost window.
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson at georgeanelson.com>
      '                              <http://www.georgeanelson.com/>


More information about the pygtk mailing list