Beispiel #1
0
    def __clicked(self, button):
        if self.__window.get_property('visible'):
            return

        if self._disable_slider:
            return

        if self.__grabbed:
            self.__popup_hide()

        window = self.__window
        frame = window.get_child()
        frame.show_all()

        window.set_transient_for(get_top_parent(self))
        # this type hint tells the wayland backend to create a popup
        window.set_type_hint(Gdk.WindowTypeHint.DROPDOWN_MENU)

        position_window_beside_widget(window, self)

        self.__grabbed = window_grab_and_map(
            window,
            Gdk.EventMask.BUTTON_PRESS_MASK |
            Gdk.EventMask.BUTTON_RELEASE_MASK |
            Gdk.EventMask.BUTTON_MOTION_MASK |
            Gdk.EventMask.POINTER_MOTION_MASK |
            Gdk.EventMask.SCROLL_MASK)
Beispiel #2
0
    def __clicked(self, button):
        if self.__window.get_property('visible'):
            return

        if self._disable_slider:
            return

        if self.__grabbed:
            self.__popup_hide()

        window = self.__window
        frame = window.get_child()
        frame.show_all()

        window.set_transient_for(get_top_parent(self))
        # this type hint tells the wayland backend to create a popup
        window.set_type_hint(Gdk.WindowTypeHint.DROPDOWN_MENU)

        position_window_beside_widget(window, self)

        self.__grabbed = window_grab_and_map(
            window,
            Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK
            | Gdk.EventMask.BUTTON_MOTION_MASK
            | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.SCROLL_MASK)
Beispiel #3
0
 def test_main(self):
     button = Gtk.Button()
     window = Gtk.Window()
     with realized(button):
         position_window_beside_widget(window, button, True)
         position_window_beside_widget(window, button, False)
Beispiel #4
0
 def test_main(self):
     button = Gtk.Button()
     window = Gtk.Window()
     with realized(button):
         position_window_beside_widget(window, button, True)
         position_window_beside_widget(window, button, False)