Re: base widgets growing uncontrollably.... ? [message #25937 is a reply to message #25898] |
Fri, 27 July 2001 16:49   |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
Paul van Delst wrote:
>
> JD Smith wrote:
>>
>> And to point out the obvious, there's no reason you can't make compound
>> widgets also objects, rather than having an all-in-one object widget
>> design. You might then have a larger object interface which "composits"
>> (i.e. includes) the sub-objects directly, perhaps creating them itself.
>>
>> Then, cleanup a simple matter of putting in place the relevant "Cleanup"
>> methods, and cleaning up your composited objects in the master Cleanup
>> (i.e. "self.fancycompoundobj1->Cleanup"). You can also allow a single
>> routine to do double duty as a master kill notify and the event<->object
>> interface (for those like me who cringe at littering the otherwise
>> pristine namespace with non-methods):
>>
>> widget_control, base,set_uvalue=self,KILL_NOTIFY="class_event",/REALIZE
>> XManager,'class',base,/NO_BLOCK
>>
>> Then the event callback looks like:
>>
>> ;; Pass on events *AND* serve as a kill notify (destroy the object)
>> pro class_event, ev_or_id
>> if size(ev_or_id,/TYPE) ne 8 then begin
>> widget_control, ev_or_id, get_uvalue=self
>> obj_destroy,self
>> return
>> endif
>> widget_control,ev_or_id.top,get_uvalue=self
>> self->Event,ev_or_id
>> end
>
> I will have to trust your much greater expertise on these matters since I'm
> still in the group (probably the minority nowadays) that has no idea how to even
> start using objects in IDL (I did give it a shot when it first came out in IDL
> 5.0(?)). When I see stuff like "self->Event,ev_or_id" the eyes glaze over and I
> take a break from work and check stock quotes or a news site. :o)
>
> Procedurally yours,
Just think how little restful break-time you'd get in a day if not for
overly compact programmatic mechanisms.
Objectingly(ively?) yours,
JD
P.S. My one line object tutorial:
objects->DoThings, withstuff, LIKE_STRUCTURES=only_smarter
|
|
|