Re: GNOME/GTK canvas




[ I know Federico already replied to this, but since I am one of the
  most happy users of the canvas, I can not ignore this and not reply ]

> You can only put selected number of items to canvas. For example,
> a spline curve widget is not supported. Right?

The Canvas is an object-oriented display engine.  This means that you
can create new displayable items and let the canvas take care of the
display and event dispatching for you.

Your new items will be drawn in a flicker-free fashion, and they will
be able to receive X-events.  Like if they were actual X windows.  

On top of that you can decorate the informtion contained in the canvas
with the pre-existing items.

> I would like to ask if it is possible to put a large drawing area
> to canvas, and to put a second but smaller drawing area over the large
> one? Both drawing areas should have their own callbacks.

This can be neatly done with the canvas.  You do not need the drawing
areas at all.  Just provide methods to repaint the exposed regions on
demand. 

> Actually, putting two windows over each other should be so trivial that
> it should be possible to implement without monsterous canvases.

GtkFixed widget will do this for you.

> Can I put any widget on the canvas? Overlapping or not?

Yes.  I think you can overlap them, but I am not sure.

> I'm not a GTK expert but I joined to gtk-devel list to ask more:
> is it possible to write a general layer widget which would be
> a container cabable of containing any other widget? 

Any derivative of the GtkContainer widget will do this.  GtkContainer
has the general framework for doing this.  A number of GtkContainers
exist

Miguel.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]