本文整理汇总了Python中ginga.gtkw.GtkHelp.make_cursor方法的典型用法代码示例。如果您正苦于以下问题:Python GtkHelp.make_cursor方法的具体用法?Python GtkHelp.make_cursor怎么用?Python GtkHelp.make_cursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ginga.gtkw.GtkHelp
的用法示例。
在下文中一共展示了GtkHelp.make_cursor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_cursor
# 需要导入模块: from ginga.gtkw import GtkHelp [as 别名]
# 或者: from ginga.gtkw.GtkHelp import make_cursor [as 别名]
def make_cursor(self, iconpath, x, y):
cursor = GtkHelp.make_cursor(self.imgwin, iconpath, x, y)
return cursor
示例2: __init__
# 需要导入模块: from ginga.gtkw import GtkHelp [as 别名]
# 或者: from ginga.gtkw.GtkHelp import make_cursor [as 别名]
#.........这里部分代码省略.........
# Set up widget as a drag and drop destination
imgwin.connect("drag-data-received", self.drop_event)
imgwin.connect("drag-motion", self.drag_motion_cb)
imgwin.connect("drag-drop", self.drag_drop_cb)
self.TARGET_TYPE_TEXT = 0
self.TARGET_TYPE_THUMB = 1
toImage = [ ( "text/plain", 0, self.TARGET_TYPE_TEXT ),
#( "text/uri-list", 0, self.TARGET_TYPE_TEXT ),
( "text/thumb", gtk.TARGET_SAME_APP,
self.TARGET_TYPE_THUMB ),
]
imgwin.drag_dest_set(gtk.DEST_DEFAULT_ALL, toImage,
gtk.gdk.ACTION_COPY)
# last known window mouse position
self.last_win_x = 0
self.last_win_y = 0
# last known data mouse position
self.last_data_x = 0
self.last_data_y = 0
# Does widget accept focus when mouse enters window
self.enter_focus = self.t_.get('enter_focus', True)
# @$%&^(_)*&^ gnome!!
self._keytbl = {
'shift_l': 'shift_l',
'shift_r': 'shift_r',
'control_l': 'control_l',
'control_r': 'control_r',
'alt_l': 'alt_l',
'alt_r': 'alt_r',
'super_l': 'super_l',
'super_r': 'super_r',
'meta_right': 'meta_right',
'asciitilde': '~',
'grave': 'backquote',
'exclam': '!',
'at': '@',
'numbersign': '#',
'percent': '%',
'asciicircum': '^',
'ampersand': '&',
'asterisk': '*',
'dollar': '$',
'parenleft': '(',
'parenright': ')',
'underscore': '_',
'minus': '-',
'plus': '+',
'equal': '=',
'braceleft': '{',
'braceright': '}',
'bracketleft': '[',
'bracketright': ']',
'bar': '|',
'colon': ':',
'semicolon': ';',
'quotedbl': 'doublequote',
'apostrophe': 'singlequote',
'backslash': 'backslash',
'less': '<',
'greater': '>',
'comma': ',',
'period': '.',
'question': '?',
'slash': '/',
'space': 'space',
'escape': 'escape',
'return': 'return',
'tab': 'tab',
'f1': 'f1',
'f2': 'f2',
'f3': 'f3',
'f4': 'f4',
'f5': 'f5',
'f6': 'f6',
'f7': 'f7',
'f8': 'f8',
'f9': 'f9',
'f10': 'f10',
'f11': 'f11',
'f12': 'f12',
'right': 'right',
'left': 'left',
'up': 'up',
'down': 'down',
}
# Define cursors
for curname, filename in (('pan', 'openHandCursor.png'),
('pick', 'thinCrossCursor.png')):
path = os.path.join(icon_dir, filename)
cur = GtkHelp.make_cursor(self.imgwin, path, 8, 8)
self.define_cursor(curname, cur)
for name in ('motion', 'button-press', 'button-release',
'key-press', 'key-release', 'drag-drop',
'scroll', 'map', 'focus', 'enter', 'leave',
):
self.enable_callback(name)