OSX 10.5 event.key bug

Using matplotlib 0.98.5 on OSX 10.5, the following error
occurs for many key_press events using the standard
connect class - letter such as c,v,s etc (and most important, backspace)

Exception in Tkinter callback
Traceback (most recent call last):
   File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py",
line 1403, in __call__
     return self.func(*args)
   File "/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py",line 312, in key_press
     FigureCanvasBase.key_press_event(self, key, guiEvent=event)
   File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py", line 1122, in
key_press_event
     self.callbacks.process(s, event)
   File "/Library/Python/2.5/site-packages/matplotlib/cbook.py", line 155, in process
     func(*args, **kwargs)
   File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py", line 1626, in key_press
     self.canvas.toolbar.back()
AttributeError: FigureCanvasTkAgg instance has no attribute 'toolbar'

would a full list of the "bad" keys help?

J

Using matplotlib 0.98.5 on OSX 10.5, the following error
occurs for many key_press events using the standard
connect class - letter such as c,v,s etc (and most important, backspace)

Exception in Tkinter callback
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
return self.func(*args)
File "/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py",line 312, in key_press
FigureCanvasBase.key_press_event(self, key, guiEvent=event)
File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py", line 1122, in key_press_event
self.callbacks.process(s, event)
File "/Library/Python/2.5/site-packages/matplotlib/cbook.py", line 155, in process
func(*args, **kwargs)
File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py", line 1626, in key_press
self.canvas.toolbar.back()
AttributeError: FigureCanvasTkAgg instance has no attribute 'toolbar'

would a full list of the "bad" keys help?

J

Using matplotlib 0.98.5 on OSX 10.5, the following error
occurs for many key_press events using the standard
connect class - letter such as c,v,s etc (and most important, backspace)

Exception in Tkinter callback
Traceback (most recent call last):
File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py",
line 1403, in __call__
return self.func(*args)
File
"/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py",line
312, in key_press
FigureCanvasBase.key_press_event(self, key, guiEvent=event)
File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py",
line 1122, in key_press_event
self.callbacks.process(s, event)
File "/Library/Python/2.5/site-packages/matplotlib/cbook.py", line 155,
in process
func(*args, **kwargs)
File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py",
line 1626, in key_press
self.canvas.toolbar.back()
AttributeError: FigureCanvasTkAgg instance has no attribute 'toolbar'

would a full list of the "bad" keys help

I am not seeing this on the 0.98.5 release candidate. I fire up

> python simple_plot.py -dTkAgg

and click 'c' somewhere on the figure/axes, or 'delete' and I am not
getting the traceback.

JDH

···

On Wed, Dec 17, 2008 at 1:24 PM, James Schombert <jschombe@...2158...> wrote:

I downloaded keypress_demo.py from the matplotlib website

runs as follows

./keypress_demo.py (then typed letter 'c')
Exception in Tkinter callback
Traceback (most recent call last):
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
     return self.func(*args)
   File "/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py", line 312, in key_press
     FigureCanvasBase.key_press_event(self, key, guiEvent=event)
   File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py", line 1122, in key_press_event
     self.callbacks.process(s, event)
   File "/Library/Python/2.5/site-packages/matplotlib/cbook.py", line 155, in process
     func(*args, **kwargs)
   File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py", line 1626, in key_press
     self.canvas.toolbar.back()
AttributeError: FigureCanvasTkAgg instance has no attribute 'toolbar'

now you are making me think something is wrong with my build, but
this is an out of the box laptop, 10.5, numpy 1.2.1, zlib-1.2.3,
freetype-2.3.7, libpng-1.2.33, then build matplotlib-0.98.5

J

note: i backed down to 0.98.3, it works fine

John Hunter wrote:

···

On Wed, Dec 17, 2008 at 1:24 PM, James Schombert <jschombe@...2158...> wrote:

Using matplotlib 0.98.5 on OSX 10.5, the following error
occurs for many key_press events using the standard
connect class - letter such as c,v,s etc (and most important, backspace)

Exception in Tkinter callback
Traceback (most recent call last):
File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py",
line 1403, in __call__
return self.func(*args)
File
"/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py",line
312, in key_press
FigureCanvasBase.key_press_event(self, key, guiEvent=event)
File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py",
line 1122, in key_press_event
self.callbacks.process(s, event)
File "/Library/Python/2.5/site-packages/matplotlib/cbook.py", line 155,
in process
func(*args, **kwargs)
File "/Library/Python/2.5/site-packages/matplotlib/backend_bases.py",
line 1626, in key_press
self.canvas.toolbar.back()
AttributeError: FigureCanvasTkAgg instance has no attribute 'toolbar'

would a full list of the "bad" keys help

I am not seeing this on the 0.98.5 release candidate. I fire up

> python simple_plot.py -dTkAgg

and click 'c' somewhere on the figure/axes, or 'delete' and I am not
getting the traceback.

JDH

can anyone recommend the best method in which to open a 2nd Tk
window from matplotlib? One where you might enter some data to
be read by the main script in an interactive way. Current attempting
an Tk commands will just reajust the plot window.

J