Why my MainWindow doesn't get he focus?

Posted by Roberto on Ask Ubuntu See other posts from Ask Ubuntu or by Roberto
Published on 2012-06-26T21:19:21Z Indexed on 2012/06/26 21:25 UTC
Read the original article Hit count: 187

window = self.builder.get_object("main-window")
print window.get_focus()
print window.has_focus()
print window.is_active()
print window.has_toplevel_focus()

Terminal output:

<MainWindow object at 0x28c26e0 (Mainwindow at 0x26a1210)>
False
False
False

So I got the right answer on get_focus(), but when I ask is MainWindows has the focus, it is return with False. Why? I don't understand it. I would like to write a method to focus_changed, but I can't if it doesn't works.

© Ask Ubuntu or respective owner

Related posts about python

Related posts about application-development