f



WIDGET_CONTROL: Invalid widget identifier:

Hi,

I am pretty new to idl but have experience in other languages. I am
working on a very large program originally created in idl 7, but I am
working in idl 8.0.1. The following has been simplified from the
program and produces an unusual error

% Stepped to: ENVI_REAL_MAIN_BASE % WIDGET_CONTROL: Invalid widget
identifier: 17.

This error persists when the problematic portion of code is isolated
as below. I have included the entire error message. Any suggestions to
my ignorance or ways to overcome/fix this problem.

pro testt
compile_opt idl2
  envi, /restore_base_save_files
  envi_batch_init

End


Thanks
David Birkigt




Producing

ENVI> testt
% Compiled module: TESTT.
% Breakpoint at: TESTT               3 C:\Users\Documents\Car\Code
\testt.pro
% Stepped to: ENVI
% Stepped to: ENVI
% Stepped to: ENVI
% Stepped to: ENVI_REAL_MAIN_BASE
% Stepped to: ENVI_REAL_MAIN_BASE
% Stepped to: ENVI_REAL_MAIN_BASE
% Stepped to: ENVI_REAL_MAIN_BASE
% Stepped to: ENVI_REAL_MAIN_BASE
% WIDGET_CONTROL: Invalid widget identifier: 17.
% Execution halted at: ENVI
%                      TESTT               3  C:\Users\Documents\Car
\Code\testt.pro
%                      $MAIN$
ENVI>
0
dbbirkigt (2)
12/5/2011 11:41:45 PM
comp.lang.idl-pvwave 12260 articles. 2 followers. Post Follow

3 Replies
1211 Views

Similar Articles

[PageSpeed] 6

DB writes: 

> I am pretty new to idl but have experience in other languages. I am
> working on a very large program originally created in idl 7, but I am
> working in idl 8.0.1. The following has been simplified from the
> program and produces an unusual error
> 
> % Stepped to: ENVI_REAL_MAIN_BASE % WIDGET_CONTROL: Invalid widget
> identifier: 17.
> 
> This error persists when the problematic portion of code is isolated
> as below. I have included the entire error message. Any suggestions to
> my ignorance or ways to overcome/fix this problem.
> 
> pro testt
> compile_opt idl2
>   envi, /restore_base_save_files
>   envi_batch_init
> 
> End

I'm not much of an ENVI person, but I *think* you have
execute those two ENVI commands from the IDL main-level.
That is, not from inside a program module. (I seem to recall
having the same problem once.)

The invalid widget identifier comes about when you try
to use a widget identifier in a command and that widget
no longer exists. This could happen, for example, if you
saved a program that used widgets, then killed all the widgets.
When you restore the program, you will have to re-create all
the widgets and update the widget identifiers. Otherwise, this
is exactly what can happen.

Cheers,

David


-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
news2122 (4023)
12/6/2011 12:31:31 AM
Thanks David,

That was the tip I needed, all it takes is a reset of the idl session
(I imagine I slopply forgot to destroy something). For some reason I
did not think of trying this before.

As usual a question out of ignorance
Thanks
David




On Dec 5, 5:31=A0pm, David Fanning <n...@dfanning.com> wrote:
> DB writes:
> > I am pretty new to idl but have experience in other languages. I am
> > working on a very large program originally created in idl 7, but I am
> > working in idl 8.0.1. The following has been simplified from the
> > program and produces an unusual error
>
> > % Stepped to: ENVI_REAL_MAIN_BASE % WIDGET_CONTROL: Invalid widget
> > identifier: 17.
>
> > This error persists when the problematic portion of code is isolated
> > as below. I have included the entire error message. Any suggestions to
> > my ignorance or ways to overcome/fix this problem.
>
> > pro testt
> > compile_opt idl2
> > =A0 envi, /restore_base_save_files
> > =A0 envi_batch_init
>
> > End
>
> I'm not much of an ENVI person, but I *think* you have
> execute those two ENVI commands from the IDL main-level.
> That is, not from inside a program module. (I seem to recall
> having the same problem once.)
>
> The invalid widget identifier comes about when you try
> to use a widget identifier in a command and that widget
> no longer exists. This could happen, for example, if you
> saved a program that used widgets, then killed all the widgets.
> When you restore the program, you will have to re-create all
> the widgets and update the widget identifiers. Otherwise, this
> is exactly what can happen.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

0
dbbirkigt (2)
12/6/2011 3:28:49 PM
On 12/5/2011 4:41 PM, DB wrote:
>
> pro testt
> compile_opt idl2
>    envi, /restore_base_save_files
>    envi_batch_init
>
> End

Don't forget to call ENVI_BATCH_EXIT at the end of TESTT (as well as any 
time TESTT would terminate with an error). The first time TESTT is 
called this won't cause a problem, but subsequent calls to TESTT in the 
same ENVI+IDL session will give the error message you're seeing.

mp
0
mpiper (74)
12/6/2011 5:02:05 PM
Reply: