Re: GooCanvasTable: column widths



On Mon, 2011-08-22 at 15:29 +0200, Murray Cumming wrote:
> I would like to specify the widths of my GooCanvasTable's columns.
> 
> At the moment, it looks like I can only specify the width of an item
> that is in a cell, like so:
> http://developer.gnome.org/goocanvas/stable/GooCanvasRect.html#GooCanvasRect--width
> 
> And I can then choose the GooCanvasTable expand and fill child
> properties:
> http://developer.gnome.org/goocanvas/stable/GooCanvasTable.html#GooCanvasTable--c-x-expand http://developer.gnome.org/goocanvas/stable/GooCanvasTable.html#GooCanvasTable--c-x-fill
> 
> - expand=TRUE means that the cell will be given extra space in addition
> to the item's own width.
> - fill=TRUE seems to affect how the item will be increased in size to
> fill that extra space. For a rect this just makes it left aligned,
> rather than center-aligned with fill=FALSE. It seems to have no effect
> on text.
> 
> But I can't seem to control the width for text items. The attached
> example shows that I can limit the width to 50 for text that needs more
> than that, forcing it to wrap. But I can't force the column width to be
> 50 if the text doesn't really need that much width. The first two
> columns in the example should have the same width.

I'm not sure if that should be considered a bug or not.

As a workaround you should be able to add an invisible rect to the
table:

  GooCanvasItem *rect = goo_canvas_rect_new (table,
    0.0f, 0.0f,
    50.0f, 1.0f,
    "stroke-pattern", NULL,
    NULL);
  goo_canvas_item_set_child_properties(table, rect,
                                       "row", 1,
                                       "column", 1,
                                       NULL);

Damon




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