Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mspacek opened this issue Jun 4, 2012 · 1 comment · Fixed by #919
Closed

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

mspacek opened this issue Jun 4, 2012 · 1 comment · Fixed by #919

Comments

@mspacek
Copy link
Contributor

mspacek commented Jun 4, 2012

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.

@pelson
Copy link
Member

pelson commented Jun 5, 2012

Fixed in #919.

Note: Related to #851 (which implements fullscreen in some other backends).

@pelson pelson closed this as completed Jun 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants