Login  Register

Re: Drawing graphs iin Dolphin

Posted by Peter Kenny-2 on Jul 07, 2004; 4:00pm
URL: https://forum.world.st/Drawing-graphs-iin-Dolphin-tp3370875p3370908.html

"Chris Uppal" <[hidden email]> wrote in message
news:[hidden email]...
> Peter,
 What I do is to use the View's #clientRectangle or
> #clientExtent to determine what to draw on.  Like Bill, I use a painting
object
> that is logically separate from the View itself, so my #onPaintRequired:
is
> roughly like:
>
>     onPaintRequired: aPaintEvent
>         self painter
>             paintOnCanvas: aPaintEvent canvas
>             in: self clientRectangle.
>
Chris - Yes! It works! This turned out to be the crucial step. I followed
all the rest of the instructions (as in Ian's tutorial on 'Buildview') and
got nothing, but as soon as I put in the clientRectangle bit the graph
appeared. At the moment it is just the curves on the graph, with no grid,
scales or headings, but they are just implementation details (famous last
words!).

Thanks to you, and to all the other people who commented. I shall bear their
words of wisdom in mind. At the moment I am just happy to have something
that works (sort of), but I may well restructure it to use a separate
drawing object - at the moment my #onPaintRequired: calls a
#drawOn:withRect: method which sits in the graph object. Some of what I did
still seems like a 'magic incantation', as Steve Geringer calls it, but I
think I have a glimmer of understanding, thanks to your description.

Peter Kenny