Re: Widget Definition from the Event Handler? [message #55924] |
Thu, 13 September 2007 08:39  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
2d@onetel.com writes:
> As i understand it, in a widget program the control goes initially to
> the Widget Definition Module and then through the xmanager to the
> Event Handler. However, how does IDL cope when it becomes necessary in
> the Event Handler part of the program to redfine a widget, say for
> example, when a table widget requires more elements? Is is possible
> through an Event Handler to redefine the dimension of a table widget,
> or must all widgets be defined absolutly in the initial Widget
> Definition Module?
Well, sort of. I'm not sure control "goes" anywhere.
Widgets appear on the display, and if events "occur"
in those widgets, IDL dispatches them to the proper event
handler. (XManager often doesn't even have to be involved.)
But it is true that you can create or modify widgets in
any IDL procedure or function that you like, including
in event handlers. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
Re: Widget Definition from the Event Handler? [message #56334 is a reply to message #55924] |
Fri, 19 October 2007 06:26  |
2d
Messages: 24 Registered: July 2007
|
Junior Member |
|
|
Many thanks for that, i've now successfully added rows to my
widget_table using insert_rows in the widget_control routine. I would
now like to extend the widget_table in both directions, that is,
extend the number of rows and the number of columns.
As i understand from the IDL help, a widget_table normally has a /
row_major default set, in which case you can extend the number of
rows, but not the number of columns, as this would require a change in
the structure. By the same token, if you manually set /column_major in
widget_table call, you can increase the number of columns, but not the
number of rows. Might there be a smart way of effectively extending
both the rows and columns of a table?
As there must be so many requirements to effectively increase both
dimensions of a table, i cant help thinking there must be a work
around for this problem. A possible idea might be to create some kind
of widget or possibly a table effectively as row_major, then in the
right most column of each element create a column_major table. This
would effectively do what i need to, effectively increasing both
dimensions of a table.
Could anyone offer any solutions?
Any help would be much appreciated, thank you.
|
|
|