comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: IDLgrView::GetByName

Re: IDLgrView::GetByName
type: item
description: 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
creator: Dick Jackson
date: 2005-11-08T21:14:22-00:00

Re: IDLgrView::GetByName
type: item
description: 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)
creator: Mark Hadfield
date: 2005-11-08T21:14:27-00:00

Re: IDLgrView::GetByName
type: item
description: 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
creator: Dick Jackson
date: 2005-11-08T21:23:56-00:00

Re: IDLgrView::GetByName
type: item
description: thank you very much for your help. I appreciate your time.
creator: IDLmastertobe
date: 2005-11-08T22:09:25-00:00