Re: fsc_surface update [message #40179] |
Wed, 14 July 2004 12:01 |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
balogna wrote:
> Sounds easy enough, but how do I check if the widget id is still valid (not
> closed by user).
>
How about using WIDGET_INFO?
valid = WIDGET_INFO(tlb, /VALID_ID)
-r
|
|
|
|
Re: fsc_surface update [message #40182 is a reply to message #40181] |
Wed, 14 July 2004 10:58  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
balogna wrote:
> Well I figured that updating the data would be no easy task, but I would
> like to be able to at least kill the old window when I open a new one. I
> thought I could do this with the window ID but I am unfamiliar with
> 'object graphics', so I don't know. Basically is there anyway for me to
> kill the window from within my program?
I haven't looked at the fsc_surface code in a long time but you could
modify it such that it returns its TLB widget ID when it is called.
Something like:
tlb = FSC_SURFACE(DIST(40))
or add a keyword:
FSC_SURFACE, DIST(40), TLB=tlb
Then in your program you would carry that id around until you want to
destroy the window:
WIDGET_CONTROL, tlb, /DESTROY
You would probably want to check to make sure that the user didn't close
the window first before trying to destroy it programatically.
Like I said, I haven't actually looked at the code but something like
this should work and should be pretty easy to hack into it.
-Rick
|
|
|
Re: fsc_surface update [message #40183 is a reply to message #40182] |
Wed, 14 July 2004 10:36  |
balogna
Messages: 5 Registered: July 2004
|
Junior Member |
|
|
Well I figured that updating the data would be no easy task, but I would
like to be able to at least kill the old window when I open a new one. I
thought I could do this with the window ID but I am unfamiliar with
'object graphics', so I don't know. Basically is there anyway for me to
kill the window from within my program?
|
|
|
Re: fsc_surface update [message #40190 is a reply to message #40183] |
Tue, 13 July 2004 17:48  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
balogna writes:
> I'm using fsc_surface to visualize data. However the user must be able to
> select which data they would like to display. Is there anyway to change
> the data that fsc_surface is plotting? Or do I have to kill the window
> and then create another one?
My goodness! 15 years I've been writing IDL programs and
finally one or two people are using them! You can't imagine
how excited I am. :-)
Well, FSC_Surface was written more or less as a direct
substitution for the Surface command. You don't necessarily
have to kill the window to visualize another surface. Just
start up another FSC_Surface command:
IDL> FSC_Surface, dist(40)
IDL> FSC_Surface, Findgen(30)#Findgen(30)
The two windows operate independently.
There are any number of problems with switching
the data in the program. Primarily because this
is an object graphics program, which means NOTHING
is all that easy. It is not a matter of just switching
the data in the IDLgrSurface object. I would also have
to re-scale all the axis objects, recompute the font
objects, etc. It's possible, but the non-object format
of the program itself discourages the attempt.
On the other hand, do you have any money
for the deluxe version? :-)
> If the latter is true how to I get the
> window/widget id from fsc_surface?
What would you do with it if you got it? Have you
worked with any object graphics programs before?
This would not be as useful to you as you might think,
I expect.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|