Skip to content

key_press_handler(): NameError: global name 'self' is not defined #918

@mspacek

Description

@mspacek

Hitting the 'f' key on a figure raises this error:

In [2]: Traceback (most recent call last):
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/backend_qt4.py", line 238, in keyPressEvent
    FigureCanvasBase.key_press_event( self, key )
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backend_bases.py", line 1608, in key_press_event
    self.callbacks.process(s, event)
  File "/home/mspacek/src/matplotlib/lib/matplotlib/cbook.py", line 312, in process
    proxy(*args, **kwargs)
  File "/home/mspacek/src/matplotlib/lib/matplotlib/cbook.py", line 239, in __call__
    return mtd(*args, **kwargs)
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backend_bases.py", line 2418, in key_press
    key_press_handler(event, self.canvas, self.canvas.toolbar)
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backend_bases.py", line 2315, in key_press_handler
    self.full_screen_toggle()
NameError: global name 'self' is not defined

self should probably be canvas.manager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions