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

Home » Public Forums » archive » Object epiphany: A new way of building widget applications
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: Object epiphany: A new way of building widget applications [message #25466 is a reply to message #25378] Wed, 13 June 2001 02:42 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
JD Smith <jdsmith@astro.cornell.edu> writes:

> Mark Hadfield wrote:
>>
>> From: "Martin Schultz" <martin.schultz@dkrz.de>
>>
>> Hi Martin (and idl-pvwave groupies)
>>
>> I finally got around to looking at your object widget stuff and I must say I
>> am impressed (though I haven't yet grasped all the ins and outs). I like the
>> idea of storing an "object reference, method name" structure in each
>> widget's UVALUE so that events from that widget can then be translated into
>> method calls. Now why didn't I think of that?
>
> Hmm... I had used something like this a few years ago, but instead I
> just saved the "action" in the UVALUE, and in the event handling method
> I used something like:
>
> widget_control, ev.id, get_uvalue=action
> if action eq 'bgroup' then action=ev.value
> case action of
> 'someaction': self->dosomething, /SOMETHING
> ....
> else: call_method,action,self ;all others, just call the method
> endcase
>
> This is actually fairly nice, since you can add new functionality to the
> widget program without ever visiting the event code, but you don't
> *require* a method for all trivial events which occur, instead just
> catching those which aren't specifically handled and sending them on
> their way to special-purpose methods. Also note how I translate
> "actions" on the fly... so for instance a button and a menu item could
> trivially perform the same function. It also pares down the even
> handler in size... always a good thing.
>
> JD

It appears to be the same idea behind this. My MGS_BaseGUI object provides
an event handler which is appropriate for many things and needs not to be
touched. So far the objref field in the widget UValue always contains
"self", and I admit, I am not sure why it should be something else ;-)

Cheers,

Martin

--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Graphics Card/GL
Next Topic: Re: IDL and NetCDF

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

Current Time: Sun Oct 12 00:58:17 PDT 2025

Total time taken to generate the page: 1.12425 seconds