Roberto
Roberto

Reputation: 178

Add get_focus() and has_focus is change to True

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, MainWindows has the focus it is return with False. Why?

Upvotes: 0

Views: 164

Answers (1)

ergosys
ergosys

Reputation: 49019

get_focus() returns the widget that would have focus if your top level window got focus.

Upvotes: 1

Related Questions