Re: Problem with save and VM [message #48592] |
Fri, 05 May 2006 08:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
MichaelT writes:
> I read the pages on modal/blocking widgets but it did not quite help me
> and I don't know if that applies to my problem.
>
> So, here is a very simple program which has the same problem as the
> real one:
> If I omit the three lines after realizing, the program works fine in
> VM. I hope that helps you helping me :-)
Ah, well. Make the XMANAGER call the LAST one in your program
and you will be fine. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Problem with save and VM [message #48593 is a reply to message #48592] |
Fri, 05 May 2006 08:35   |
MichaelT
Messages: 52 Registered: May 2006
|
Member |
|
|
I read the pages on modal/blocking widgets but it did not quite help me
and I don't know if that applies to my problem.
So, here is a very simple program which has the same problem as the
real one:
PRO TEST, GROUP = GROUP
BASIS = WIDGET_BASE(XSIZE = 400, YSIZE = 300, /COLUMN)
INFO = {TYPE: 'LOAD'}
B_LOAD = WIDGET_DRAW(BASIS, XSIZE = 24, YSIZE = 24,
/BUTTON_EVENTS, UVALUE = INFO)
XMANAGER, 'TEST', BASIS, GROUP_LEADER = GROUP, /NO_BLOCK
WIDGET_CONTROL, BASIS, /REALIZE
WIDGET_CONTROL, B_LOAD, GET_VALUE = WID
WSET, WID
PLOTS, [0, 1], [0, 1], /NORMAL
END
PRO TEST_EVENT, EV
WIDGET_CONTROL, EV.ID, GET_UVALUE = INFO
CASE INFO.TYPE OF
'LOAD': BEGIN
END
ENDCASE
END
If I omit the three lines after realizing, the program works fine in
VM. I hope that helps you helping me :-)
Michael
|
|
|
|
|
Re: Problem with save and VM [message #48618 is a reply to message #48617] |
Wed, 03 May 2006 18:05   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
MichaelT writes:
> Thanks for your quick answer, David. As I am not an IDL expert I am not
> quite sure what that means, though :-/
Well, this is probably something else, then. :-)
> In my program I try to use the draw widgets immediately after realizing
> the GUI (main program). That is the part that is obviously the problem,
> because I don't get that error message after ommiting these lines.
> How can I circumvent this? I already tried to put all this into another
> sub-routine, but without success.
You might have to start with a MUCH simpler program and
show it to us.
> ps.: Your great IDL page has given me valuable IDL programming tips
> countless times, thanks for that :-)
I'd read the articles on widget programming again, especially the
one of the difference between blocking and modal widgets, and maybe
the article on modal dialog widgets. But I'm thrilled that
you are reading. Thanks. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
|
Re: Problem with save and VM [message #48631 is a reply to message #48630] |
Wed, 03 May 2006 06:07   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
MichaelT writes:
> I have come across a problem that I am not able to solve myself.
>
> I have programmed a GUI using widgets which runs fine under IDL 6.0. No
> problems. Then I exported it to a .sav file using "save, 'file.sav',
> /routines" after compiling and "resolve all", to distribute it to some
> other people.
> I tested the .sav and I always get the following error message:
> "The following error was encountered: WIDGET_CONTROL: Invalid widget
> identifier: 3.
>
> So obviously the program is not able to identify the widget that I try
> to use for drawing some initial figure. The same (with a different
> identifier) occurs with all other widgets.
>
> All that worked fine in a previous, less developed version of the
> program.
>
> What is going on? Can anybody help?
The most common reason widget programs fail in the VM is that
they rely on command line blocking instead of being written
as modal widgets. Thus, programs run through their blocks
and try to act with information that hasn't been collected
yet.
It is hard to tell if this is the problem here, but this
is where I would look first.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|