Formatting WIDGET_TABLE cells? [message #50937] |
Mon, 23 October 2006 03:59  |
Harald Jeszenszky
Messages: 9 Registered: January 1997
|
Junior Member |
|
|
Hi,
When I try to format some WIDGET_TABLE columns holding double precision data
I always get the following error message:
WIDGET_CONTROL, (*ptr).idData, USE_TABLE_SELECT=[4,0,9,9],
FORMAT='(F15.3)'
%WIDGET_CONTROL: Unable to set format for table widget
If I use ALIGNMENT=2 instead of FORMAT='(F15.3)' the cells are
right-justified as expected, so it could not be a matter of cell selection.
Any idea?
Thanks,
Harald
|
|
|
Re: Formatting WIDGET_TABLE cells? [message #51532 is a reply to message #50937] |
Tue, 21 November 2006 12:08  |
jjones
Messages: 1 Registered: November 2006
|
Junior Member |
|
|
It looks like on a table widget the FORMAT keyword to WIDGET_CONTROL
will only be allowed on selected cells, which were ***initialized***
with an explicit FORMAT setting. A bug report has been entered on this.
In the meantime, the below WIDGET_TABLE( ) function call syntax would
work around this problem:
PRO selectable_table_ex
data = string(findgen(6,10))
tlb = widget_base(/COLUMN)
wTable = widget_table(tlb, /EDITABLE, VALUE=data, $
FORMAT=replicate('(d7.3)', size(data, /DIMENSIONS)), $
ALIGNMENT=2)
widget_control, tlb, /REALIZE
widget_control, wTable, USE_TABLE_SELECT=[4,0,4,3], $
FORMAT=replicate('(d4.1)',1,4)
END
Note that this only works if the FORMAT keyword to WIDGET_TABLE( ) is
an array, and it only enables all cells, if that array's size is equal
to the full size of the table.
Harald Jeszenszky wrote:
> Hi,
>
> When I try to format some WIDGET_TABLE columns holding double precision data
> I always get the following error message:
>
> WIDGET_CONTROL, (*ptr).idData, USE_TABLE_SELECT=[4,0,9,9],
> FORMAT='(F15.3)'
>
> %WIDGET_CONTROL: Unable to set format for table widget
>
> If I use ALIGNMENT=2 instead of FORMAT='(F15.3)' the cells are
> right-justified as expected, so it could not be a matter of cell selection.
>
> Any idea?
>
> Thanks,
> Harald
|
|
|