當前位置: 首頁>>代碼示例>>Python>>正文


Python Gdk.Cursor方法代碼示例

本文整理匯總了Python中gi.repository.Gdk.Cursor方法的典型用法代碼示例。如果您正苦於以下問題:Python Gdk.Cursor方法的具體用法?Python Gdk.Cursor怎麽用?Python Gdk.Cursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gi.repository.Gdk的用法示例。


在下文中一共展示了Gdk.Cursor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: stop_zooming

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def stop_zooming(self, *args):
        """ Cancel the zooming, if it was enabled.

        Returns:
            `bool`: whether the event was consumed
        """
        Cursor.set_cursor(self.p_central)
        self.zoom_selecting = False
        self.zoom_points = None
        self.scale = 1.
        self.shift = (0, 0)
        self.set_scribble_zoomout_sensitive(False)
        self.menu_zoom_out.set_sensitive(False)

        self.redraw_current_slide()
        self.clear_cache()

        return True 
開發者ID:Cimbali,項目名稱:pympress,代碼行數:20,代碼來源:extras.py

示例2: nav_zoom

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def nav_zoom(self, name, ctrl_pressed, command = None):
        """ Handles an key press event: stop trying to select an area to zoom.

        Args:
            name (`str`): The name of the key pressed
            ctrl_pressed (`bool`): whether the ctrl modifier key was pressed
            command (`str`): the name of the command in case this function is called by on_navigation

        Returns:
            `bool`: whether the event was consumed
        """
        if not self.zoom_selecting:
            return False

        elif command == 'cancel':
            Cursor.set_cursor(self.p_central)
            self.zoom_selecting = False
            self.zoom_points = None
            return True

        return False 
開發者ID:Cimbali,項目名稱:pympress,代碼行數:23,代碼來源:extras.py

示例3: __on_button_press

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def __on_button_press(self, item, target, event):
    if event.button == 1 and not self.__cropping_box:
      canvas = item.get_canvas()
      self.__dragging = True
      self.__start_x = event.x
      self.__start_y = event.y
      self.__rubberband = GooCanvas.CanvasRect(
          x=event.x, y=event.y, width=0, height=0,
          stroke_color_rgba=0x66CCFF55,
          fill_color_rgba=0xFFEECC66,
          line_width=2.0)
      canvas.get_root_item().add_child(self.__rubberband, next_index())
      fleur = Gdk.Cursor(Gdk.CursorType.FLEUR)
      canvas.pointer_grab(
          item,
          Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK,
          fleur,
          event.time)

    return True 
開發者ID:linuxerwang,項目名稱:pdf-quench,代碼行數:22,代碼來源:pdf_quench.py

示例4: change_wallpaper_async

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def change_wallpaper_async(self):

        def on_change_wallpaper_done(result, error):
            self.get_window().set_cursor(None)

        @async_function(on_done=on_change_wallpaper_done)
        def do_change_wallpaper_in_thread():
            self.save_preferences()
            change_wallpaper()
            return True

        self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
        do_change_wallpaper_in_thread() 
開發者ID:atareao,項目名稱:daily-wallpaper,代碼行數:15,代碼來源:main.py

示例5: _launch_disconnect_thread

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def _launch_disconnect_thread(self, widget=None):
        watch_cursor = Gdk.Cursor(Gdk.CursorType.WATCH)
        self._win.get_window().set_cursor(watch_cursor)
        self._connect_btn.start_spinner()
        self._connect_btn.set_sensitive(False)

        # Force the spinner to show on the window.
        while Gtk.events_pending():
            Gtk.main_iteration()

        t = threading.Thread(target=self._threaded_disconnect)
        t.start() 
開發者ID:KanoComputing,項目名稱:kano-settings,代碼行數:14,代碼來源:NetworkScreen.py

示例6: _set_cursor_to_hand_cb

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def _set_cursor_to_hand_cb(self, widget, data=None):
        widget.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.HAND1)) 
開發者ID:KanoComputing,項目名稱:kano-settings,代碼行數:4,代碼來源:set_style.py

示例7: toggle_cursor

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def toggle_cursor(widget, hide=False):
  window = widget.get_window()

  if window:
    blank  = Gdk.CursorType.BLANK_CURSOR
    cursor = Gdk.Cursor(blank) if hide else None
    GLib.idle_add(window.set_cursor, cursor) 
開發者ID:jonian,項目名稱:kickoff-player,代碼行數:9,代碼來源:gtk.py

示例8: bg_button_press_cb

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def bg_button_press_cb(self, widget, event):
        """
        Enter in scroll mode when mouse button pressed in background
        or call option menu.
        """
        if event.button == 1 and event.type == Gdk.EventType.BUTTON_PRESS:
            widget.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.FLEUR))
            self._last_x = event.x
            self._last_y = event.y
            self._in_move = True
            return True
        elif is_right_click(event):
            self.on_show_option_menu_cb(widget, event)
            return True
        return False 
開發者ID:gramps-project,項目名稱:addons-source,代碼行數:17,代碼來源:TimelinePedigreeView.py

示例9: set_header_cursor

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def set_header_cursor(self, eb, *a):
		""" Sets cursor over top part of infobox to hand """
		eb.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.HAND1)) 
開發者ID:kozec,項目名稱:syncthing-gtk,代碼行數:5,代碼來源:infobox.py

示例10: add_map_data

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def add_map_data(self, location):
		# append to listbox
		text = '{"x": %d, "y": %d, "width": %d, "height": %d, "color": "%s"}' % location
		self.map_data_listbox.append_text(text)
		# append to view
		point = maps.to_array(text)
		self.map_view.add_point(point, 'Resource', MiniMap.point_colors['Resource'])
		self.select_resource_button.set_sensitive(True)
		self.set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW)) 
開發者ID:AXeL-dev,項目名稱:Dindo-Bot,代碼行數:11,代碼來源:main.py

示例11: on_select_resource_button_clicked

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def on_select_resource_button_clicked(self, button):
		button.set_sensitive(False)
		self.set_cursor(Gdk.Cursor(Gdk.CursorType.CROSSHAIR))
		Thread(target=self.wait_for_click, args=(self.add_map_data, self.game_window_location)).start() 
開發者ID:AXeL-dev,項目名稱:Dindo-Bot,代碼行數:6,代碼來源:main.py

示例12: add_click

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def add_click(self, location):
		x, y, width, height, color = location
		twice = self.click_twice_switch.get_active()
		self.path_listbox.append_text('Click(x=%d,y=%d,width=%d,height=%d,twice=%s)' % (x, y, width, height, twice))
		self.select_button.set_sensitive(True)
		self.set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW)) 
開發者ID:AXeL-dev,項目名稱:Dindo-Bot,代碼行數:8,代碼來源:main.py

示例13: on_select_button_clicked

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def on_select_button_clicked(self, button):
		button.set_sensitive(False)
		self.set_cursor(Gdk.Cursor(Gdk.CursorType.CROSSHAIR))
		Thread(target=self.wait_for_click, args=(self.add_click, self.game_window_location)).start() 
開發者ID:AXeL-dev,項目名稱:Dindo-Bot,代碼行數:6,代碼來源:main.py

示例14: on_enter_notify

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def on_enter_notify(self, widget, event):
		window = self.get_window()
		window.set_cursor(Gdk.Cursor(Gdk.CursorType.HAND1)) 
開發者ID:AXeL-dev,項目名稱:Dindo-Bot,代碼行數:5,代碼來源:custom.py

示例15: on_select_pixel_button_clicked

# 需要導入模塊: from gi.repository import Gdk [as 別名]
# 或者: from gi.repository.Gdk import Cursor [as 別名]
def on_select_pixel_button_clicked(self, button):
		button.set_sensitive(False)
		self.parent.set_cursor(Gdk.Cursor(Gdk.CursorType.CROSSHAIR))
		# wait for click
		Thread(target=self.parent.wait_for_click, args=(self.add_pixel, self.parent.game_window_location)).start() 
開發者ID:AXeL-dev,項目名稱:Dindo-Bot,代碼行數:7,代碼來源:dev.py


注:本文中的gi.repository.Gdk.Cursor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。