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

Home » Public Forums » archive » Ghost Widgets!
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
Ghost Widgets! [message #77440] Tue, 30 August 2011 07:31
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I've run into an odd situation today: ghost widgets!

The problem concerns cgWindow, which is an "object widget".
In other words, cgWindow is an object containing widgets,
and in particular a top-level base widget. The program is set
up so that if the user kills the top-level base widget in any
way whatsoever, the top-level base (and its draw widget)
and the object itself will be destroyed. This all happens
in a clean-up call-back routine, triggered upon the death
of the top-level base.

All this works great, except....

Except, if I am debugging a program that uses a cgWindow
I have seen extremely strange things happen. (This is
where the story gets weird. Those of you easily frightened
by ghosts may want to stop reading here.) Suppose, for
example, I put a breakpoint in my code and step though
the lines that creates the cgWindow and loads it. The
first time I do this, all is well. I see the window,
I see the commands loading, etc.

But, suppose now I want to do this again. While my
program is stopped and I am stepping through the lines
in the file, I decide I want to start over. So I kill
the cgWindow with the mouse, I re-compile my program
that has the breakpoint in it, run it and step though
the lines again. This time NOTHING! No window. No error.
No nothing! What the ...!?

It turns out that the top-level base widget never
actually got killed, even though it is clearly
nowhere to be found on my display. If I go looking
for the object widget, I can find it. If I inquire
whether it has a valid top-level base, it tells me
it does. And, in fact, the draw widget is a valid
draw widget with a valid window index number! And,
get this, I am writing graphics commands into a valid
window that I can't possibly see! What the ...!?

OK, maybe I could just kill the object and all
would be well. But I can't just go around willy-
nilly killing objects. I have to have some
justification for doing so. (There are courts
of law for this sort of thing.) And, there is
NOTHING about this object that says it is
deficient in any way. It just doesn't exist on
my display!!!

You might think the solution would be to exit
the stopped routine after I had killed the
widget and before I compiled and ran the
program again. But, even this doesn't work.
I just can't figure out a way to get into
my clean-up routine from withing a stopped
program.

Any ideas?

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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Porting OS X IDL 7.0 to Linux IDL 8.0
Next Topic: Re: Porting OS X IDL 7.0 to Linux IDL 8.0

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

Current Time: Thu Oct 09 06:46:46 PDT 2025

Total time taken to generate the page: 0.48217 seconds