gtk/hildon: is there a signal for when the *window* gets focus
the "set-focus" -signal is for any widget in the window which is way too often for my needs. I just want to check if certain data is still fresh when the program main window gets focus (either via task manager [if it was in background] or when returning from a subview [which I could do via other means too but one signal to rule them all would be great]).
I'm doing this in python in case that detail matters (it should not). I tried to look for it last night but I may have been blind (or just tired). |
Re: gtk/hildon: is there a signal for when the *window* gets focus
Try the "notify::is-topmost" property of HildonWindow. That should do the trick.
http://maemo.org/api_refs/5.0/5.0-fi...ow--is-topmost |
Re: gtk/hildon: is there a signal for when the *window* gets focus
Quote:
I found that there is 'focus' signal on gtk.Widget from which just about everything inherits from but unfortunatly that gets triggered for the window only at program start (even switching between programs does not trigger it), same for 'window-state-event' I guess part of the problem is using window vs stackablewindow offer no difference here (and stackablewindow is definitely the way to go). edit: and also the set-focus is not usable since when I return from stackable window or other application the previous widget still retains it's focus... |
Re: gtk/hildon: is there a signal for when the *window* gets focus
Every property emits a signal whenever it's value is changed. The "notify::" part will do the trick. Try something like this:
Code:
g_signal_connect (win, "notify::is-topmost", G_CALLBACK(cb_func), NULL); |
Re: gtk/hildon: is there a signal for when the *window* gets focus
Quote:
Quote:
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') "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) |
Re: gtk/hildon: is there a signal for when the *window* gets focus
Quote:
window.connect("notify::is-topmost", callback) |
All times are GMT. The time now is 21:15. |
vBulletin® Version 3.8.8