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

Home » Public Forums » archive » Re: IDLitComponent - Introspection
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: IDLitComponent - Introspection [message #44015 is a reply to message #44013] Wed, 11 May 2005 16:48 Go to previous messageGo to previous message
Robert Barnett is currently offline  Robert Barnett
Messages: 70
Registered: May 2004
Member
I'm soon to send a feature request to RSI about it. What do you think about the following procedures?

;CallGetProperty.pro
;+
; NAME:
; CallGetProperty
;
; PURPOSE:
; To get the property of an object, when the keyword is only known at runtime.
;
; CATEGORY:
; Introspection
;
; CALLING SEQUENCE:
; CallGetProperty, obj, kwd, value
;
; INPUTS:
; obj: The object from which to obtain the property
; kwd: The keyword name of the property
;
; OUTPUTS:
; value: The value of the property
;
; SIDE EFFECTS:
; Expects to be able to make a single call "obj -> GetProperty"
;
; EXAMPLE:
;
; ; Define an object
;
; pro boringobj__define
; struct = {boringobj, boringproperty: ''}
; end
;
; pro boringobj::GetProperty, BORINGPROPERTY=boringproperty
; if (arg_present(boringproperty)) then $
; boringproperty = self.boringproperty
; end
;
; ; Get its property
;
; CallGetProperty, obj_new('boringobj'), 'BORINGPROPERTY', value
; print, value
;
;-
pro CallGetProperty, obj, kwd, value
; Unknown implementation
end



;CallSetProperty.pro
;+
; NAME:
; CallSetProperty
;
; PURPOSE:
; To set the property of an object, when the keyword is only known at runtime.
;
; CATEGORY:
; Introspection
;
; CALLING SEQUENCE:
; CallSetProperty, object, kwd, value
;
; INPUTS:
; object: The object from which to obtain the property
; kwd: The keyword name of the property
; value: The value of the property
;
; SIDE EFFECTS:
; Expects to be able to make a single call "obj -> SetProperty"
;
; EXAMPLE:
;
; ; Define an object
;
; pro boringobj__define
; struct = {boringobj, boringproperty: ''}
; end
;
; pro boringobj::SetProperty, BORINGPROPERTY=boringproperty
; if (n_elements(boringproperty) gt 0) then $
; self.boringproperty = boringproperty
; end
;
; ; Set its property
;
; CallSetProperty, obj_new('boringobj'), 'BORINGPROPERTY', 'boring value'
;
;-
pro CallSetProperty, obj, kwd, value
obj -> SetProperty, _EXTRA=create_struct(kwd, value)
end


============================================================ ===========

The actual application I had in mind was a configuration tool.
I have objects with properties which I would like to be able to
edit via a GUI at runtime. I can do this very effectively by using
widget_propertysheet.

However, I have numerous objects and do not want to bother setting up a
widget_propertysheet for each object individually. Instead, I wish to
query objects for properties which are 'IDLContainer's and
automatically generate a widget_tree based on the links between objects.

--

nrb@ Robbie Barnett
imag Research Assistant
wsahs Nuclear Medicine & Ultrasound
nsw Westmead Hospital
gov Sydney Australia
au +61 2 9845 7223
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: an error of type 5 has occurred
Next Topic: How to apply a function to an array?

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

Current Time: Fri Oct 10 00:59:45 PDT 2025

Total time taken to generate the page: 0.64322 seconds