Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: Widget Even...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 10 Topic 5581 of 6457
Post > Topic >>

Re: Widget Event_Pro question

by Spon <christoph.blau@[EMAIL PROTECTED] > Apr 2, 2008 at 08:38 AM

On Apr 2, 4:23 pm, David Fanning <n...@[EMAIL PROTECTED]
> wrote:
> Spon writes:
> > I need to define this array before any instances of widget B are open.
> > Can I use a value of [-1L] for this? Or is -1 a valid widget ID number
> > that might cause problems later if IDL decides to label one of my
> > widgets -1 at some point?
>
> All widget IDs are positive. But, a pointer comes
> to mind, too. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Se****e ma de ni thui. ("Perhaps thou speakest truth.")

I think I'm already doing what you suggest, but just to be sure:

Graphs = PTR_NEW([-1L])
UVal = {Img:Img $
          ... ;
          ... ; Loads of other garbage
        Graphs:Graphs }
WIDGET_CONTROL, Base, SET_UVALUE = UVal

And then, when I realize a graph widget:
     ; Register the widget with top level UVal structure
    *UVal.Graphs = [(*UVal.Graphs), GraphBase]
    WIDGET_CONTROL, Event.Top, SET_UVAL = UVal

     ; Register top level widget ID in Graph widget UVAL
    GraphUVal = { GroupLeader:Event.Top }
    WIDGET_CONTROL, GraphBase, SET_UVAL = GraphUVal

Is this what you meant by using a pointer? Or could I do it more
efficiently? The main problem this creates is in my graph deleting
procedure, where I have to first check if the array contains any non-
minus-one entries and then loop through them all, destroying the
associated widgets and reseting them to -1.

Oh, and another question while I'm at it: I'm trying to check if a
widget still exists before trying to load its UVal, I thought that

IF WIDGET_INFO(GraphUVal.GroupLeader, /ACTIVE) THEN BEGIN

would do what I want, but apparently the /ACTIVE keyword doesn't work
with an argument.

Chris
 




 10 Posts in Topic:
Widget Event_Pro question
Spon <christoph.blau@[  2008-03-31 04:29:56 
Re: Widget Event_Pro question
David Fanning <david@[  2008-03-31 06:45:55 
Re: Widget Event_Pro question
Spon <christoph.blau@[  2008-03-31 07:14:46 
Re: Widget Event_Pro question
David Fanning <news@[E  2008-03-31 08:45:03 
Re: Widget Event_Pro Bingo
Spon <christoph.blau@[  2008-03-31 07:43:11 
Re: Widget Event_Pro question
Spon <christoph.blau@[  2008-04-02 08:21:04 
Re: Widget Event_Pro question
David Fanning <news@[E  2008-04-02 09:23:49 
Re: Widget Event_Pro question
Spon <christoph.blau@[  2008-04-02 08:38:16 
Re: Widget Event_Pro question
David Fanning <news@[E  2008-04-02 09:47:39 
Re: Widget Event_Pro question
Spon <christoph.blau@[  2008-04-02 09:10:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 21:36:56 CST 2008.