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

Home » Public Forums » archive » Re: xmanager to call object methods?
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: xmanager to call object methods? [message #39127 is a reply to message #39118] Wed, 21 April 2004 08:16 Go to previous messageGo to previous message
mmiller3 is currently offline  mmiller3
Messages: 81
Registered: January 2002
Member
>>>> > "Oliver" == Oliver Thilmann <justspam03@yahoo.de> writes:

> Hi, is there any generic way to handle events via objects,
> i.e. make xmanager (or something like it) call an object
> method instead of a function or procedure?

> The reason is that in my current design, I use the uvalue
> of evt.top to store a reference to the object currently
> handling UI input in the respective window and then call
> the event-handler of that object from an intermediate
> function. Alas, that's not possible in all cases. Without
> going into details: I ended up trying to pull myself out of
> the swamps by my own hair as Munchhausen did.


There is generic_class_event in the RSI user-contrib ligbrary
http://www.rsinc.com/codebank/search.asp?FID=209 . (and I'll
stick a copy below...)

Mike

--
Michael A. Miller mmiller3@iupui.edu
Imaging Sciences, Department of Radiology, IU School of Medicine


;+
; This routine is called when an event occurs in any object-based TLB.
; In turn, the ::EVENT method of the class whose object reference is
; stored in the EVENT.HANDLER's UVALUE is called.
;
; @Param
; Event {in}{required}{type=structure}
; Any sort of IDL GUI event
;
; @Examples
; <pre>
; Widget_Control, TLB, Set_UValue = self, Event_Pro = 'Generic_Class_Event' <br>
; XMANAGER, 'GENERIC_CLASS', TLB
; </pre>
;
; @History
; June, 2001 : JLP, RSI
;-
Pro Generic_Class_Event, Event
COMPILE_OPT STRICTARR
Widget_Control, Event.Handler, Get_UValue = oSelf
If (N_elements(oSelf) eq 1) then Begin
If (Obj_Valid(oSelf)) then Begin
;
; A class that uses this routine must have a method
; named "::EVENT".
;
oSelf->Event, Event
EndIf
EndIf
End
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDLgrLegend Property Sheets, array properties
Next Topic: A very simple FORMAT question

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

Current Time: Sun Oct 12 04:51:20 PDT 2025

Total time taken to generate the page: 0.48316 seconds