本文整理汇总了Python中ginga.gtkw.GtkHelp.get_scroll_info方法的典型用法代码示例。如果您正苦于以下问题:Python GtkHelp.get_scroll_info方法的具体用法?Python GtkHelp.get_scroll_info怎么用?Python GtkHelp.get_scroll_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ginga.gtkw.GtkHelp
的用法示例。
在下文中一共展示了GtkHelp.get_scroll_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scroll_event
# 需要导入模块: from ginga.gtkw import GtkHelp [as 别名]
# 或者: from ginga.gtkw.GtkHelp import get_scroll_info [as 别名]
def scroll_event(self, widget, event):
# event.button, event.x, event.y
x = event.x; y = event.y
degrees, direction = GtkHelp.get_scroll_info(event)
self.logger.debug("scroll deg=%f direction=%f" % (
degrees, direction))
data_x, data_y = self.get_data_xy(x, y)
self.last_data_x, self.last_data_y = data_x, data_y
return self.make_ui_callback('scroll', direction, degrees,
data_x, data_y)
示例2: scroll_event
# 需要导入模块: from ginga.gtkw import GtkHelp [as 别名]
# 或者: from ginga.gtkw.GtkHelp import get_scroll_info [as 别名]
def scroll_event(self, widget, event):
# event.button, event.x, event.y
x = event.x
y = event.y
self.last_win_x, self.last_win_y = x, y
degrees, direction = GtkHelp.get_scroll_info(event)
self.logger.debug("scroll deg=%f direction=%f" % (
degrees, direction))
data_x, data_y = self.check_cursor_location()
return self.make_ui_callback('scroll', direction, degrees,
data_x, data_y)