【发布时间】:2014-10-28 10:25:23
【问题描述】:
我在用户右击时向他们显示一个弹出菜单。
根据弹出窗口的行为,我想在它失去焦点时销毁弹出窗口(当用户在弹出窗口外单击时)。为此,我尝试使用 Glade 将弹出窗口连接到“focus-out-event”。但由于某种原因,该事件没有被触发。触发事件时,我尝试在终端上打印一些内容,但没有打印任何内容。
我是 Python 和 GTK 的新手,现在我不知道如何继续。
#handler to catch the focus out event
def on_popup_menu_add_attachment_focus_out_event(self, *args):
print("Destroying the popup.....")
焦点输出信号及其处理程序
【问题讨论】:
标签: python gtk popupwindow glade