Esempio n. 1
0
    def on_mouse_right_down(self, event, position):
        item = self.get_item_at_position(position)

        if item:
            self.select_item(item)
            if item.create_context_menu:
                menu = item.create_context_menu(self, item, position)
                if menu:
                    gtkutils.show_context_menu(menu, event)
            return

        self.scroll_point = position
        self.canvas.set_cursor(get_cursor("scroll"))
Esempio n. 2
0
    def on_mouse_right_down(self, event, position):
        item = self.get_item_at_position(position)

        if item:
            self.select_item(item)
            if item.create_context_menu:
                menu = item.create_context_menu(self, item, position)
                if menu:
                    gtkutils.show_context_menu(menu, event)
            return

        self.scroll_point = position
        self.canvas.set_cursor(get_cursor("scroll"))
Esempio n. 3
0
 def _button_down(self, w, event):
     def call(f):
         return lambda w: f(self.selected_object())
     if event.button == 3 and self.has_context_menu:
         x = int(event.x)
         y = int(event.y)
         pathinfo = self.container.view.get_path_at_pos(x, y)
         if pathinfo is not None:
             path, col, cellx, celly = pathinfo
             self.container.view.grab_focus()
             self.container.view.set_cursor(path, col, 0)
         menu = self.get_context_menu()
         if menu is not None:
             gtkutils.show_context_menu(menu, event)
             return True
Esempio n. 4
0
    def _button_down(self, w, event):
        def call(f):
            return lambda w: f(self.selected_object())

        if event.button == 3 and self.has_context_menu:
            x = int(event.x)
            y = int(event.y)
            pathinfo = self.container.view.get_path_at_pos(x, y)
            if pathinfo is not None:
                path, col, cellx, celly = pathinfo
                self.container.view.grab_focus()
                self.container.view.set_cursor(path, col, 0)
            menu = self.get_context_menu()
            if menu is not None:
                gtkutils.show_context_menu(menu, event)
                return True