Re: GTK+ canvas?



Marco Pesenti Gritti wrote:

This seem to imply a box based layout for the canvas, similar to the gtk one. In one of your previous canvas posts you was talking of more powerful layout managers (to be able to layout widgets around a shape for example). Something turned down that idea?


If HippoCanvas were "real" then it should maybe have layout managers separate from items, and ability to specify different layout managers. But it would be important to implement these in such a way that they didn't make doing basic stuff way more annoying. e.g. if I'm creating a big tree of items with boxes as the containers, I don't want the code to have a zillion canvas_item_set_layout_manager() calls in it. Maybe an object property like this would not be too bad: g_object_new(TYPE_CANVAS_CONTAINER, "layout", TYPE_CANVAS_LAYOUT_BOX, NULL);

but I think this would be bad:

 container = g_object_new(TYPE_CANVAS_CONTAINER, NULL);
 layout = box_layout_new();
 container_set_layout_manager(container, layout);

that would get old quickly.

A short list of layouts covers almost all needs though, so pluggable layout managers are a little overrated. If you have boxes, esp. with the improvements of 4-side padding, alignment, avoiding the gtk H-separate-from-V glitch, then that covers the common case. You might occasionally need fixed-positioning, or a table. I guess you could do a layout manager that was like css "float" also.

I can't think of more than a short list of layout managers that would be widely used. Application-specific layouts could be useful though, e.g. "put these items in a circle" or "flow items around this item" or something like that.

Havoc




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