def __toggled_cb(self, widget): menu = self.__menu if widget.get_active() and menu: time = Gtk.get_current_event_time() qltk.popup_menu_under_widget(menu, widget, 0, time) elif menu: menu.popdown()
def __toggled_cb(self, widget): menu = self.__menu if widget.get_active() and menu: time = gtk.get_current_event_time() qltk.popup_menu_under_widget(menu, widget, 0, time) elif menu: menu.popdown()
def test_popup_menu_under_widget(self): w = gtk.Window() l = gtk.Label() w.add(l) m = gtk.Menu() l.realize() qltk.popup_menu_under_widget(m, l, 1, 0) w.destroy() m.destroy()
def test_popup_menu_under_widget(self): w = Gtk.Window() l = Gtk.Label() w.add(l) m = Gtk.Menu() l.realize() qltk.popup_menu_under_widget(m, l, 1, 0) w.destroy() m.destroy()
def test_popup_menu_under_widget(self): w = Gtk.Window() l = Gtk.Label() w.add(l) m = Gtk.Menu() m.attach_to_widget(l, None) w.show_all() qltk.popup_menu_under_widget(m, l, 1, 0) w.destroy() m.destroy()
def _popup(self): event = Gtk.get_current_event() ok, button = event.get_button() if not ok: button = Gdk.BUTTON_PRIMARY time = event.get_time() if self._down: qltk.popup_menu_under_widget(self.__menu, self, button, time) else: qltk.popup_menu_above_widget(self.__menu, self, button, time)
def __showmenu(self, column, event=None): time = event.time if event else Gtk.get_current_event_time() if event is not None and event.button != Gdk.BUTTON_SECONDARY: return False menu = self._menu(column) menu.attach_to_widget(self, None) if event: menu.popup(None, None, None, None, event.button, time) return True widget = column.get_widget() qltk.popup_menu_under_widget(menu, widget, 3, time) return True
def __showmenu(self, column, event=None): time = event.time if event else Gtk.get_current_event_time() if event is not None and event.button != Gdk.BUTTON_SECONDARY: return False menu = self.__getmenu(column) menu.attach_to_widget(self, None) if event: menu.popup(None, None, None, None, event.button, time) return True widget = column.get_widget() qltk.popup_menu_under_widget(menu, widget, 3, time) return True
def __popup(self, safter, widget, button=3, time=None): time = time or gtk.get_current_event_time() if widget: return qltk.popup_menu_under_widget(safter, widget, button, time) else: safter.popup(None, None, None, button, time) return True
def __showmenu(self, column, event=None): time = gtk.get_current_event_time() if event is not None and event.button != 3: return if event: self.__getmenu(column).popup(None, None, None, event.button, time) return True widget = column.get_widget() return qltk.popup_menu_under_widget(self.__getmenu(column), widget, 3, time)
def __popup_menu(self, menu, player, event=None): for child in menu.get_children()[2:-1]: menu.remove(child) child.destroy() try: marks = player.song.bookmarks except AttributeError: # song is None pass else: items = qltk.bookmarks.MenuItems(marks, player, self.__seekable) items.reverse() for i in items: menu.insert(i, 2) if event: qltk.popup_menu_at_widget(menu, self, 3, event.time) else: time = Gtk.get_current_event_time() qltk.popup_menu_under_widget(menu, self, 3, time) return True
def __popup(self, widget, menu): time = Gtk.get_current_event_time() button = 3 return qltk.popup_menu_under_widget(menu, widget, button, time)
def __press_cb(self, widget, event): if self.__menu and event.button == Gdk.BUTTON_PRIMARY: qltk.popup_menu_under_widget( self.__menu, widget, event.button, event.time) widget.set_active(True) return False
def __press_cb(self, widget, event): if self.__menu and event.button == 1: qltk.popup_menu_under_widget( self.__menu, widget, event.button, event.time) widget.set_active(True) return False