On Fri, Jul 18, 2008 at 4:27 AM, David M. Kaplan <[EMAIL PROTECTED]> wrote:

> So just to make sure that I understand this, "MyInteractiveBackend"
> would be any backend canvas class for whom we want to implement the
> standard generic mixin.  For example, the class FigureCanvasGTK would
> inherit FigureCanvasEventLoopMixin until we get around to writing
> something specific for GTK.  On the other hand, FigureCanvasWx wouldn't
> inherit the mixin, but would use the WX specific code you sent
> yesterday.  And FigureCanvasPs wouldn't get anything at all.  Am I
> getting this?
>
> If so, then I will go ahead and make the appropriate modifications.
> Looking at the list of backends, I think it suffices to inherit the
> mixin for the following backends: cairo, cocoagg, fltkagg?, gdk?, gtk,
> qt4, qt, tkagg (wx covered with its own code).  All other interactive
> backends should inherit from these.  The ones with the question marks I
> am not really sure about, but will assume true unless told otherwise.

I'm not a huge fan of mixins.  We use them occassionally, eg for
FigureCanvasGtkAgg and their are some good uses for them, but they can
quickly lead to overly complex code so should be avoided  where
possible.  I find the "deeper hierarchy" approach more appealing here,
but am not sure if it is viable.  For example

  class FigureCanvasGTKAgg(FigureCanvasGTK, FigureCanvasAgg)

inherits from an interactive and a non-interactive backend, which is a
good example of how quickly multiple mixin inheritance can get tricky.
 I think perhaps it is best to create no new classes, put the base
methods in the FigureCanvasBase, make the default behavior
non-interactive, and then overrride them for the GUI backends.  Any
problems with this?

Finally, the term "interactive" is a bit confusing and overloaded
here, since "is_interactive" in mpl means someone is working from the
interactive shell and we want to update the figure on every command
(if draw_if_interactive).  For clarity, I think we should refer to
this as a "user interface" backend or something like that,.  I know in
parts of the backend code we have the designation of interactive
backends, but these variables should probably be renamed to avoid
further confusion, since the other use of interactive is already
enshrined in the frontend api and rc file.

JDH

-------------------------------------------------------------------------
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