本文整理汇总了Python中matplotlib.backend_bases.FigureCanvasBase.button_release_event方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasBase.button_release_event方法的具体用法?Python FigureCanvasBase.button_release_event怎么用?Python FigureCanvasBase.button_release_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backend_bases.FigureCanvasBase
的用法示例。
在下文中一共展示了FigureCanvasBase.button_release_event方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: button_release_event
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def button_release_event(self, widget, event):
if _debug: print 'FigureCanvasGTK.%s' % fn_name()
x = event.x
# flipy so y=0 is bottom of canvas
y = self.allocation.height - event.y
FigureCanvasBase.button_release_event(self, x, y, event.button, guiEvent=event)
return False # finish event propagation?
示例2: mouseReleaseEvent
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def mouseReleaseEvent( self, event ):
x = event.x()
# flipy so y=0 is bottom of canvas
y = self.figure.bbox.height - event.y()
button = self.buttond[event.button()]
FigureCanvasBase.button_release_event( self, x, y, button )
if DEBUG: print 'button released'
示例3: button_release_event
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def button_release_event(self, widget, event):
x = event.x
# flipy so y=0 is bottom of canvas
y = self.get_allocation().height - event.y
FigureCanvasBase.button_release_event(
self, x, y, event.button, guiEvent=event)
return False # finish event propagation?
示例4: mouseReleaseEvent
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def mouseReleaseEvent(self, event):
x, y = self.mouseEventCoords(event)
button = self.buttond.get(event.button())
if button is not None:
FigureCanvasBase.button_release_event(self, x, y, button,
guiEvent=event)
if DEBUG:
print('button released')
示例5: mouseReleaseEvent
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def mouseReleaseEvent( self, event ):
x = event.x()
# flipy so y=0 is bottom of canvas
y = self.figure.bbox.height - event.y()
button = self.buttond.get(event.button())
if button is not None: # only three buttons supported by MouseEvent
FigureCanvasBase.button_release_event( self, x, y, button )
if DEBUG: print('button released')
示例6: mouseReleaseEvent
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def mouseReleaseEvent(self, event):
x = event.x()
# flipy so y=0 is bottom of canvas
y = self.figure.bbox.height - event.y()
button = self.buttond.get(event.button())
if button is not None:
FigureCanvasBase.button_release_event(self, x, y, button, guiEvent=event)
if DEBUG:
print("button released")
示例7: button_release_event
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def button_release_event(self, event):
x = event.x
# flipy so y=0 is bottom of canvas
y = self.figure.bbox.height - event.y
num = getattr(event, 'num', None)
if sys.platform == 'darwin':
# 2 and 3 were reversed on the OSX platform I tested under tkagg.
if num == 2: num = 3
elif num == 3: num = 2
FigureCanvasBase.button_release_event(self, x, y, num, guiEvent=event)
示例8: handle
# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import button_release_event [as 别名]
def handle(self, event):
x=Fltk.Fl.event_x()
y=Fltk.Fl.event_y()
yf=self._source.figure.bbox.height - y
if event == Fltk.FL_FOCUS or event == Fltk.FL_UNFOCUS:
return 1
elif event == Fltk.FL_KEYDOWN:
ikey= Fltk.Fl.event_key()
if(ikey<=255):
self._key=chr(ikey)
else:
try:
self._key=special_key[ikey]
except:
self._key=None
# TODO: Handle ctrl, alt, super modifiers.
FigureCanvasBase.key_press_event(self._source, self._key)
return 1
elif event == Fltk.FL_KEYUP:
FigureCanvasBase.key_release_event(self._source, self._key)
self._key=None
elif event == Fltk.FL_PUSH:
self.window().make_current()
if Fltk.Fl.event_button1():
self._button = 1
elif Fltk.Fl.event_button2():
self._button = 2
elif Fltk.Fl.event_button3():
self._button = 3
else:
self._button = None
if self._draw_overlay:
self._oldx=x
self._oldy=y
if Fltk.Fl.event_clicks(): # according to docs, event_clicks() returns nonzero if this is a double click.
FigureCanvasBase.button_press_event(self._source, x, yf, self._button, dblclick=True)
return 1
else:
FigureCanvasBase.button_press_event(self._source, x, yf, self._button)
return 1
elif event == Fltk.FL_ENTER:
self.take_focus()
return 1
elif event == Fltk.FL_LEAVE:
return 1
elif event == Fltk.FL_MOVE:
FigureCanvasBase.motion_notify_event(self._source, x, yf)
return 1
elif event == Fltk.FL_DRAG:
self.window().make_current()
if self._draw_overlay:
self._dx=Fltk.Fl.event_x()-self._oldx
self._dy=Fltk.Fl.event_y()-self._oldy
Fltk.fl_overlay_rect(self._oldx,self._oldy,self._dx,self._dy)
FigureCanvasBase.motion_notify_event(self._source, x, yf)
return 1
elif event == Fltk.FL_RELEASE:
self.window().make_current()
if self._draw_overlay:
Fltk.fl_overlay_clear()
FigureCanvasBase.button_release_event(self._source, x, yf, self._button)
self._button = None
return 1
return 0