【问题标题】:GTK focus-out-eventGTK 聚焦事件
【发布时间】: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


    【解决方案1】:

    我刚刚将 Type 更改为 Top Level 并且它起作用了!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-13
      • 1970-01-01
      • 1970-01-01
      • 2016-05-06
      • 2010-12-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多