Re: Clearing fields in widgets [message #17786] |
Mon, 08 November 1999 00:00 |
Sean Heukels
Messages: 25 Registered: November 1999
|
Junior Member |
|
|
Thanks for that code3, it surely gives a new view to the structures I use in
some programs.
But ...
To make it even more difficult, some of these structures defined in info
{...}
are widgets, others are normal values. So I have to do a check first to find
out if the structure is a widget or not then reset the value. This code
doesn't do this.
Sean
|
|
|
Re: Clearing fields in widgets [message #17788 is a reply to message #17786] |
Mon, 08 November 1999 00:00  |
m218003
Messages: 56 Registered: August 1999
|
Member |
|
|
In article <80630o$o96$1@newshost.accu.uu.nl>,
"News" <janek@dds.nl> writes:
> I created a widget where you can load multiple functions with different
> numbers of variables to use as input.
> NOw I created a button to clear these fields in a own PRO called clearval
> and here I open the structure info defined as the U_VALUE of the top.widget.
>
> The problem now is that I clear all the fields here and as soon as I want to
> clear a field that HAS been defined in the structure info, but just hadn't
> been filled with data, creates an error.
> I can ofcourse create seperate PRO clearval 's but i want to solute it an
> other way.
>
> Anyone have a clue ??
> Thank u Sean
>
> [...] Code snipped[/color]
(1) replace your info.vari by a loop as in:
for I=0L,N_Tags(info)-1 do $
WIDGET_CONTROL, info.(I), SET_VALUE=""
(2) can't understand how you can define a tag in a structure and have
NOT assigned a value to it. If you are running into trouble because
you are trying to redefine a structure tag with a different variable
type, you could use the SIZE function. E.g. if you only want to reset
strings in the above loop:
for I=0L,N_Tags(info)-1 do $
if (Size(info.(I),/TNAME) eq 'STRING') then $
WIDGET_CONTROL, info.(I), SET_VALUE=""
Hope this helps somewhat,
Martin
--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
|
|
|