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

Home » Public Forums » archive » Re: IDLgrView::GetByName
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
Re: IDLgrView::GetByName [message #46216] Tue, 08 November 2005 14:09
IDLmastertobe is currently offline  IDLmastertobe
Messages: 54
Registered: June 2004
Member
thank you very much for your help. I appreciate your time.
Re: IDLgrView::GetByName [message #46218 is a reply to message #46216] Tue, 08 November 2005 13:23 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Mark Hadfield in New Zealand wrote:

> IDL> otop = oview->GetByName('top')
> IDL> ogroup = oview->GetByName('top/group')
> IDL> obox = oview->GetByName('top/group/box')

Dick Jackson in Canada wrote:

> oTop = oView -> GetByName('oTop')
> oGroup = oTop -> GetByName('oGroup')
> oBox = oGroup -> GetByName('oBox')

You'll note that both of these work fine, your choice of approach may depend
on which side of the world you're on. :-)

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
Re: IDLgrView::GetByName [message #46219 is a reply to message #46218] Tue, 08 November 2005 13:14 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
IDLmastertobe wrote:
> Hi, I am dealing with IDLgrView object named oView, oView holds a lot of
> other objects. I am trying to get access to those objects by using
> oView->GetByName function as follows:
>
> oView -> GetByName, oTop=oTop
> oTop -> GetByName, oGroup = oGroup
> oGroup->GetByName, oBox = oBox
> oBox -> SetProperty, thick=3
>
> oTop was added to oView and oGroup was added to oTop, maybe the chain
> GetByName structure is not necessary, but i received an error message:
>
> "Attempt to call undefined method: 'IDLGRVIEW::GETBYNAME'."
>
> why is GetByName not defined in IDLgrView oView?
>
> Does anyone know why? Thanks for your time.

Well, all objects of the IDLgrView class and its subclasses should have
a GetByName method (since version 5.0, the first version in which Object
Graphcis appeared). But the problem may be that you aren't calling it
right. It takes no keyword arguments, only a single positional argument
which should be a scalar string.

Here is how you might use it

IDL> oview = obj_new('IDLgrView')
IDL> otop = obj_new('IDLgrModel', NAME='top')
IDL> oview->Add, otop
IDL> ogroup = obj_new('IDLgrModel', NAME='group')
IDL> otop->Add, ogroup
IDL> obox = obj_new('IDLgrPolygon', NAME='box')
IDL> ogroup->Add, obox

(I'm just guessing about the object types.)

Then, later, when you've lost the references to the contained objects

IDL> otop = oview->GetByName('top')
IDL> ogroup = oview->GetByName('top/group')
IDL> obox = oview->GetByName('top/group/box')

IDL> print, otop, ogroup, obox
<ObjHeapVar10009(IDLGRMODEL)><ObjHeapVar10011(IDLGRMODEL)><ObjHeapVar10013(IDLGRPOLYGON) >



--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: IDLgrView::GetByName [message #46220 is a reply to message #46219] Tue, 08 November 2005 13:14 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi,

"IDLmastertobe" <shi_lee@hotmail.com> wrote in message
news:a6f3fee6b8f98956d9d1912f01028d97@localhost.talkaboutpro gramming.com...
> Hi, I am dealing with IDLgrView object named oView, oView holds a lot of
> other objects. I am trying to get access to those objects by using
> oView->GetByName function as follows:
>
> oView -> GetByName, oTop=oTop
> oTop -> GetByName, oGroup = oGroup
> oGroup->GetByName, oBox = oBox
> oBox -> SetProperty, thick=3
>
> oTop was added to oView and oGroup was added to oTop, maybe the chain
> GetByName structure is not necessary, but i received an error message:
>
> "Attempt to call undefined method: 'IDLGRVIEW::GETBYNAME'."
>
> why is GetByName not defined in IDLgrView oView?
>
> Does anyone know why? Thanks for your time.

It's defined, but it's a function, not a procedure, requiring a string to
match some object's Name property. If your oTop object was created with
Name='oTop' (and other objects named similarly), you could then do this:

oTop = oView -> GetByName('oTop')
oGroup = oTop -> GetByName('oGroup')
oBox = oGroup -> GetByName('oBox')
oBox -> SetProperty, thick=3

Online help on IDLgrView::GetByName is helpful here.

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLgrView::GetByName
Next Topic: Overlay multiple filled contour plots?

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

Current Time: Fri Oct 10 10:58:49 PDT 2025

Total time taken to generate the page: 0.64138 seconds