[Gtk-sharp-list] DrawingArea - allocating needed space

Piotr Zurek p.zurek at gmail.com
Fri Nov 10 01:59:51 EST 2006


Hi there,

First of all, sorry for crossposting, but slowly losing hope for getting 
any answer from gtk-sharp-list. Maybe someone will prove me wrong...

Anyway, I need a word of advice on using DrawingArea.
In my application the user is supposed to draw all elements in all 
directions around one central element. Let's say that I start with an 
empty drawing and I draw the first element in the center of the area 
allocated for the my drawing. The application automatically places all 
elements so that they do not overlap. Sooner or later the user hits a 
point where the allocated area is not enough. I have to allocate some 
more space. It's not a problem if it grows to the right or down - I can 
use SetSizeRequest to grow it. But what if it has to grow to the left or 
up? Do I have to move the the central element from the initial position 
  evey time I need to make some more space for elements above or on the 
left? I think I could probably do it that way but maybe somehow I can 
use the SizeAllocate (or something else) and use negative values for my 
drawing coordiantes?

I hope I described it clear enough but if not, please let me know.

Cheers
Piotr


More information about the Gtk-sharp-list mailing list