[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Canvas framework
From: |
Guilhem BONNEFILLE |
Subject: |
Re: Canvas framework |
Date: |
Mon, 6 Feb 2006 23:32:40 +0100 |
Well, I tried and I tried and I'm always confused. My "simple" (?)
application doesn't work as I wish.
In few words: I have a background (just call it MapView, inheriting from
NSView) which holds 3 crossed-points (just call them PointView,
inheriting from NSView). My need, is to click on MapView and draw a
PointView where I clicked. These draw must be kept in their RELATIVE
place when MapView is scaled.
Why NSView for Points? Because I wish to be able later to detect click
in order to interpret as selection.
In my current design, each PointView is responsible of maintaining
itself at the correct place. It does itself the setFrame: call. But,
when I scale the window (and so, the MapView) the PointView seems to not
be redraw correctly.
In short, I'm confused with:
- what should look the MapView's drawRect.
- who should be responsible of the setFrame on the PointView (the
PointView itself or the MpaView).
Do you know an example of a simple vector editor? In my mind, what I
want to do is something like a vector editor. So an example handling
simple form would be nice.
On Wed, 1 Feb 2006 08:18:21 +0000
Nicolas Roard <nicolas.roard@gmail.com> wrote:
> On 2/1/06, Guilhem BONNEFILLE <Guilhem.Bonnefille@laposte.net> wrote:
> > Hi,
> >
> > For my first application is an image as background and some
> > reference points. I wish to allow the user selecting, moving,
> > erasing easily these points.
> >
> > Is there any canvas framework on GNUStep? By canvas, I mean a
> > framework that assume the management of the graphical objects: I
> > give it graphical object, with coords and layer level, and it called
> > me back when an object is selected, moved...
> >
> > I've looked for such thing on internet with "canvas" keyword, but it
> > is unsuccessful.
>
> It's because the whole -gui on GNUstep is mostly done with what you'd
> call a canvas.
> The display is vectoriel, and using NSView give you discrete objects.
> So in fact for a canvas,
> you could simply define NSViews, add them as subview to a NSView you'd
> use as a "board".
> Now to let the user manipulate the NSViews (eg, move them), and in
> your NSViews, simply intercept mouse events to do whatever you want
> (eg move the objects, or do some action, etc)
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/DrawViews/index.html#//apple_ref/doc/uid/10000079i
>
> --
> Nicolas Roard
> "Any sufficiently advanced technology is indistinguishable from
> magic."
> -Arthur C. Clarke
--
Guilhem BONNEFILLE
-=- #UIN: 15146515 JID: guyou@im.apinc.org MSN:
guilhem_bonnefille@hotmail.com
-=- mailto:guilhem.bonnefille@laposte.net
mailto:guilhem.bonnefille@free.fr
-=- http://nathguil.free.fr/