Re: GNOME/GTK canvas



>From:	Federico Mena Quintero <federico@nuclecu.unam.mx>
>
>You can do that.  I wouldn't think putting drawing areas inside the
>canvas as being a very useful idea :-)  Just let the canvas do the
>drawing for you.

I have done it! I used the gtkfixed widget to put two drawing areas
to one window. You can draw to them both and you can move them.
If interested, please look at "http://www.funet.fi/~kouhia/gui.tar.gz".

Draw with mb1 and move with ctrl-mb1. One of the drawing_areas is
always under the other --- that is fine for me, since I have full size
background pixmap in my application. I don't know what happens if I add
multiple smaller drawing areas over that large pixmap --- perhaps
I need a possibility to raise and lower the drawing areas. For example,
the moving drawing area would be the topmost drawing area.

There are some problems: if, while moving a drawing area, the pointer
goes on the other drawing area, the pointer draws and the button release
of the moving drawing area might be missed (causing the drawing area to
move without any button pressings).

Also, gtk_fixed_move() makes a configure event (why?). To avoid recreating
pixmaps all of the time, I create the pixmaps only once. Simple moving of
the drawing areas need not create configure events. Also, resizing the
fixed window need not create configure event for drawing areas. Perhaps
there is a situation where pixmaps should be configured again but I didn't
find any. Anyone? Should gtk_fixed_move() be corrected? I feel it would
be better to create only the expose event and not the configure event.


>>  Actually, putting two windows over each other should be so trivial that
>>  it should be possible to implement without monsterous canvases.
>
>If you think the canvas is monstrous, please do tell why.  I am always
>interested in making it leaner.  It is very lean already.

But of course. I dislike when code has to be rewritten. It would be
simple if all existing widgets could be put to your canvas items and
there would not be a need to write special canvas items. Ever counted
how many times the spline code appears in Gnome, Gimp, Gtk systems?
It is everywhere and now you suggested me to write yet another spline
routines. It would be practical if existing spline widget could be
used "as is" in the canvas widget.

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

So what is this story about not having spline item in your canvas?
Perhaps I have misunderstood. If any widget can be put on canvas,
I could take the existing spline widget and forget the incomplete
line canvas item.

>I think you are rather confused on the way widgets and windows work.

Heh. At least I have asked multiple times if somebody could explane me
what is a widget.

Yours,

Juhana



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