Hi,

I have finally committed a changeset for moving the "event loop" stuff
into the backends.  I have hopefully found a compromise that will please
most.  Since this is close to release date, I suggest that everyone who
can give it a look (r5831) and if there is any problem, just role the
changes back and release with the old code.

My compromise was the following:

1) In FigureCanvasBase, create start/stop_event_loop that raise errors.
I kept these names instead of wait_start wait_stop because I think
things like start_event_loop is used in other programming contexts to
denote the same things.  In the documentation string, I tried to make it
clear that this is not the overall GUI event loop.  If people aren't
happy, changing is a fairly simple find and replace.

2) In FigureCanvasBase, I also created start/stop_event_loop_default.
These do the standard time.sleep thing.  start_event_loop_default throws
a deprecated warning saying it should be replaced by a gui specific
version.  Once we have the gui specific versions, I still think we
should keep this function around as this code is very simple and
straightforward and is likely to work on almost anything.  For example,
if we ever had a problem with a backend, we could always use this till a
fix was found.

3) In cocoagg, fltkagg, gtk, qt, qt4, and tkagg, I implemented
fall-through functions for start/stop_event_loop that simply call the
default versions.

4) In WX, I used the code submitted by Paul, but was unable to check it
because when I tried to use the WX backend, I got an error about no
GraphicsContext (below).  This looks bad.  I am using wxPython: 2.6.3.2.

Again, any problem with this, just role the changes back until after the
release.

Cheers,
David


Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 1035, in _onPaint
    self.draw(repaint=False)
  File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 903, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
724, in draw
    if self.frameon: self.patch.draw(renderer)
  File "/usr/lib/python2.5/site-packages/matplotlib/patches.py", line
257, in draw
    gc = renderer.new_gc()
  File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 360, in new_gc
    self.gc = GraphicsContextWx(self.bitmap, self)
  File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 457, in __init__
    gfx_ctx = wx.GraphicsContext.Create(dc)
<type 'exceptions.AttributeError'>: 'module' object has no attribute
'GraphicsContext'


-- 
**********************************
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France

Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http://www.ur097.ird.fr/team/dkaplan/index.html
**********************************


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to