def on_button_press(self, target, event, user_data): if event.button == 3: menu = mk_notebook_context_menu(self) menu.connect("hide", MenuHideCallback(self.guake.window).on_hide) try: menu.popup_at_pointer(event) except AttributeError: # Gtk 3.18 fallback ("'Menu' object has no attribute 'popup_at_pointer'") menu.popup(None, None, None, None, event.button, event.time) return False
def on_button_press(self, target, event, user_data): if event.button == 3: menu = mk_notebook_context_menu(self) menu.connect("hide", MenuHideCallback(self.guake.window).on_hide) try: menu.popup_at_pointer(event) except AttributeError: # Gtk 3.18 fallback ("'Menu' object has no attribute 'popup_at_pointer'") menu.popup(None, None, None, None, event.button, event.time) elif event.type == Gdk.EventType.DOUBLE_BUTTON_PRESS and event.button == 1: self.new_page_with_focus() return False
def on_button_press(self, target, event, user_data): if event.button == 3: menu = mk_notebook_context_menu(self) menu.connect("hide", MenuHideCallback(self.guake.window).on_hide) try: menu.popup_at_pointer(event) except AttributeError: # Gtk 3.18 fallback ("'Menu' object has no attribute 'popup_at_pointer'") menu.popup(None, None, None, None, event.button, event.time) elif event.type == Gdk.EventType.DOUBLE_BUTTON_PRESS and event.button == 1: self.new_page_with_focus() return False