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

Home » Public Forums » archive » Objects and Widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: objects and widgets [message #49222 is a reply to message #19933] Thu, 06 July 2006 07:36 Go to previous messageGo to previous message
larkn10 is currently offline  larkn10
Messages: 10
Registered: July 2006
Junior Member
Another thing you can do is something like the following:

;GET ALL VALID OBJECTS
ov = obj_valid()

;COUNT THE INSTANCES OF YOUR CLASS
className = 'TheNameOfYourClass'
count = 0
for i=0,n_elements(ov)-1 do begin
if obj_isa(ov[i],className) gt 0 then count++
endfor;i
print,count

;IF YOU WANT THE OBJECT REFERENCE(S)
if count gt 0 then begin
ref = obj_arr(count)
for i=0,n_elements(ov)-1 do begin
if obj_isa(ov[i],className) gt 0 then ref = ov[i]
endfor;i
endif


This would retrieve all subclasses of the class you are
interested in, so you might want to do something more to
search for the specific class you need.

You probably wouldn't want to do this in a program, but
it could be useful at times.

-Larry
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Avoid loop in matrix operation
Next Topic: reading data from file

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

Current Time: Fri Oct 10 03:51:27 PDT 2025

Total time taken to generate the page: 0.71020 seconds