|
|
Re: Table Column Width [message #464665 is a reply to message #464584] |
Mon, 28 November 2005 13:40 |
Eclipse User |
|
|
|
Originally posted by: e.s.com
is there some way to "tell" the table to resize itself to fit the text
size or to adjust according to its parent composite?
|
|
|
|
|
Re: Table Column Width [message #464875 is a reply to message #464584] |
Wed, 30 November 2005 20:51 |
Jeremy Dowdall Messages: 48 Registered: July 2009 |
Member |
|
|
I could be way off, but what the heck! :)
in TreeColumn's Pack routine:
int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
if (OS.gtk_tree_model_get_iter_first (parent.modelHandle, iter)) {
do {
width = Math.max (width, parent.calculateWidth (handle, iter));
} while (OS.gtk_tree_model_iter_next(parent.modelHandle, iter));
}
OS.g_free (iter);
seems that it needs to tunnel down through all the children here, as
it's currently just getting the direct children of the parent tree
Veronika Irvine wrote:
> TableColumn.pack() will size the column to be as wide as its widest item.
> It is not "automatic" in that you have to call it each time you change the
> text or image for a TableItem.
>
> "Martin" <xx@xx.com> wrote in message
> news:45ad0f30aa23f90ce161d177632a7834$1@www.eclipse.org...
>
>>Hi,
>>is there a way that the columns of a table are automatically resized
>>depending on the text that is in it's cells. At the moment i use the work
>>around to determine the average character width from a GC and multiply it
>>with the maximum number of characters in this column, which i think is
>>very messy (especially because it's only the average character width, so i
>>have to add at least 1 or 2 pixels per character so that the column is
>>really big enough)
>>
>>Thanks
>>Martin
>>
>
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03960 seconds