View Single Post
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#5
Originally Posted by conny View Post
Every property emits a signal whenever it's value is changed.
Recalled something like that but the problem is attaching the signal to the property

Originally Posted by conny View Post
The "notify::" part will do the trick. Try something like this:
Code:
g_signal_connect (win, "notify::is-topmost", G_CALLBACK(cb_func), NULL);
Any idea how to do that in python ?

Edit: I was stupid (and tired) and parsed the C wrong at first...

Code:
self.mainwindow.connect('notify::is-topmost', self.got_focus, 'notify::is-topmost')
Works fine.

"Problem" is that I get this signal for every subwindow instantiated as well but that is a minor annoyance, thanks.

edit2: I realized that of course I get the signal every time I change away from the window, it's no longer topmost... duh! (yes I was tired last night)

Last edited by rambo; 2010-03-30 at 04:35.
 

The Following 2 Users Say Thank You to rambo For This Useful Post: