Login  Register

Re: Drawing graphs iin Dolphin

Posted by Chris Uppal-3 on Jul 07, 2004; 8:27am
URL: https://forum.world.st/Drawing-graphs-iin-Dolphin-tp3370875p3370905.html

Bill,

> I think it is better to add yet another object that provides this service
> to said view, and can be rescaled for printers, etc.

Agreed entirely.  I use a "painter" object that is logically separate from the
View too -- in fact it's an "editable aspect" of the View so I can still create
and configure them in the VC, but am not tied to using them to paint on
Windows.


> Peter, if you create something that renders obects on a canvas, then you
> can create a bitmap, obtain its #canvas, have your evolving code draw on
> it, and then use an ImagePresenter to display the results.  That approach
> will save you some hassles with zombie presenters - the voice of
> experience talking :) Once everything works, you can more easily/safely
> create a model/presenter pair to make it easier to use.

That's a good idea.  I tend to do it the other way around, though, and develop
with the painter object drawing directly into an open View -- that does have
the advantage in immediacy, but I do have to put a

    on: Error
    do: [err | err notify]

around the painting code in #onPaintRequired: to avoid the risk of a cascade of
walkbacks.

    -- chris