Main Page | Report Page

 

  Computers Forum Index » Computer Languages (IDL-PVWAVE) » GetLastChild...

Author Message
Truong Le...
Posted: Thu Oct 21, 2010 9:29 pm
 
Hi,

I am trying to get of the last child within a parent tag. However, I
always get the first child instead.
Any help is appreciated.

Thanks
 
David Fanning...
Posted: Fri Oct 22, 2010 2:29 am
 
Truong Le writes:

Quote:
I am trying to get of the last child within a parent tag. However, I
always get the first child instead.

Get the first child of the parent, then look for
siblings until you get to the last, spoiled
child. That's the old that breaks the bank when
it comes to college expenses. :-(

sib = event.id
child = event.id
WHILE sib NE 0 DO BEGIN
sib = Widget_Info(child, /SIBLING)
IF sib NE 0 THEN child = sib
ENDWHILE
lastsib = child

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
 
Doug Edmundson...
Posted: Fri Oct 22, 2010 3:21 am
 
On 10/21/10 3:29 PM, Truong Le wrote:

Quote:
I am trying to get of the last child within a parent tag. However, I
always get the first child instead.

The ALL_CHILDREN and N_CHILDREN keywords to WIDGET_INFO() should do the
trick.

Cheers,
Doug
 
David Fanning...
Posted: Fri Oct 22, 2010 3:29 am
 
Doug Edmundson writes:

Quote:
The ALL_CHILDREN and N_CHILDREN keywords to WIDGET_INFO() should do the
trick.

Better than my low-tech solution, probably. ;-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
 
 
Page 1 of 1    
All times are GMT
The time now is Thu Aug 28, 2014 1:32 am