3
我在右键单击时向用户显示一个弹出式菜单。GTK聚焦事件
根据弹出的行为,我想在失去焦点时(当用户在弹出窗口外单击时)销毁弹出窗口。为此,我尝试使用Glade将弹出窗口连接到“专注事件”。但由于某种原因,该事件并未被解雇。当事件被触发时,我试图在终端上打印一些东西,但没有打印。
我是新来的Python和GTK,现在我不知道如何进一步进行。
#handler to catch the focus out event
def on_popup_menu_add_attachment_focus_out_event(self, *args):
print("Destroying the popup.....")
重点出信号和其处理程序