comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Getting WIDGET_TABLE Number of rows and columns
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Getting WIDGET_TABLE Number of rows and columns [message #88903] Wed, 02 July 2014 10:33 Go to next message
Ken G is currently offline  Ken G
Messages: 14
Registered: September 2006
Junior Member
Is there a direct way to ask a WIDGET_TABLE the number of rows and columns it currently has?

I wish WIDGET_TABLE was more forgiving about SET_VALUE and such, but if you exceed the size of the table, IDL throws an error, so it pays to know the size (and set the size) of the table properly before using SET_VALUE to set the contents.
So far, all I've been able to think up is this kludge.

Ncols = N_ELEMENTS( WIDGET_INFO(tableID, /COLUMN_WIDTHS) )
Nrows = N_ELEMENTS( WIDGET_INFO(tableID, /ROW_HEIGHTS) )

Essentially we ask for an array of widths and heights, and then infer the table dimensions from the number of elements in each array.

Thanks!
Re: Getting WIDGET_TABLE Number of rows and columns [message #88919 is a reply to message #88903] Thu, 03 July 2014 09:51 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On Wednesday, July 2, 2014 7:33:47 PM UTC+2, Ken G wrote:
> Is there a direct way to ask a WIDGET_TABLE the number of rows and columns it currently has?
>
>
>
> I wish WIDGET_TABLE was more forgiving about SET_VALUE and such, but if you exceed the size of the table, IDL throws an error, so it pays to know the size (and set the size) of the table properly before using SET_VALUE to set the contents.
>
> So far, all I've been able to think up is this kludge.
>
>
>
> Ncols = N_ELEMENTS( WIDGET_INFO(tableID, /COLUMN_WIDTHS) )
>
> Nrows = N_ELEMENTS( WIDGET_INFO(tableID, /ROW_HEIGHTS) )
>
>
>
> Essentially we ask for an array of widths and heights, and then infer the table dimensions from the number of elements in each array.
>
>
>
> Thanks!

What about:
Widget_CONTROL, tableID, GET_VALUE=table
dims = Size(table, /DIM)

alx.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Multiple plot with mapCoord
Next Topic: Gaussfit problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:36:05 PDT 2025

Total time taken to generate the page: 0.00463 seconds