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()
예제 #2
0
 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()
예제 #3
0
 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()
예제 #4
0
 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()
예제 #5
0
 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()
예제 #6
0
 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()
예제 #7
0
    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)
예제 #8
0
    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
예제 #9
0
    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
예제 #10
0
 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
예제 #11
0
    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)
예제 #12
0
    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
예제 #13
0
    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
예제 #14
0
 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
예제 #16
0
 def __popup(self, widget, menu):
     time = Gtk.get_current_event_time()
     button = 3
     return qltk.popup_menu_under_widget(menu, widget, button, time)
예제 #17
0
 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