RE: Canvas limitations (was Re: Coding question, canvas)
- From: James Henstridge <james daa com au>
- To: Richard Hult <rhult hem2 passagen se>
- cc: Havoc Pennington <hp Mcs Net>, gnome-list gnome org
- Subject: RE: Canvas limitations (was Re: Coding question, canvas)
- Date: Tue, 9 Feb 1999 17:31:30 +0800 (WST)
A grid would definitely benefit from having its own canvas item, since you
probably would only need to store the origin and spacing in the structure
(rather than the start and end points for many lines). If you were to
implement a grid this way, the only problem I can think of is how to
generate the bounds for the grid (for use with aa canvas) easily (would
you have to do anything more complex than just the grid's bounding
rectangle?).
I am not sure of the details of how to do this, as I haven't implemented
any canvas items myself.
James Henstridge.
--
Email: james@daa.com.au
WWW: http://www.daa.com.au/~james/
On Tue, 9 Feb 1999, Richard Hult wrote:
>
> Thanks for all the answers! Time for some more questions ;)
>
> > The other limit is that it takes a noticeable amount of time to create
> > the GtkObjects if you create, say, hundreds of them (vs. 50 or so which
> > will be plenty fast). Of course this number varies radically depending on
> > your CPU and exactly which items you're using.
>
> So a "grid" (dots that objects snap to) would be a candidate for an own
> canvas item? I tried putting lots of rectangles on my canvas and it's not
> exactly slow but it takes a bit of memory.
>
> Something that comes to mind is that it's a kind of weird object. It covers
> the whole canvas but there is a lot of space really, just some dots here and
> there. Will this cause lots of redraw requests, when objects move over the
> grid, even over the space between the dots? This seems a bit inefficient.
>
> I'm not completely clear about exactly what's involved in making a canvas
> item, so these questions may be a bit irrelevant ;)
>
> Is there a commented example of this somewhere in the sources? Is a
> copy-and-paste-operation from the already defined canvasitems the way to go?
>
> /Richard
>
>
> --
> FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
> To unsubscribe: mail gnome-list-request@gnome.org with
> "unsubscribe" as the Subject.
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]