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

Home » Public Forums » archive » Re: Q on widget programming style
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: Q on widget programming style [message #12425 is a reply to message #12421] Tue, 28 July 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mirko Vukovic (mvukovic@my-dejanews.com) writes:

> In my widget programming I tend to assign an event handler to each widget
> (well, almost), since that eliminates testing on the origin of the event,
> and produces somewhat cleaner code.
>
> But are there any pitfalls to that practice?

Uh, it produces a lot of code. :-)

I tend, these days, to use a lot of event handlers too, but
I tend to group them by logical function or utility. For example,
all of the buttons in the "Processing" pull-down menu will be
handled by the same event handler. Or all the "color tools" will
be handled by the same event handler, etc.

This tends to cut down on the amount of code a little bit
and makes it easier to find the part of the code I want to
work on.

I'm also very big these days on writing compound widgets as
objects. Normally this will mean a single event handler, but
many methods for the compound widget. Maybe it's my imagination,
but it seems very elegant to me. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: background processing and widget_event
Next Topic: IDLDE on MacOS edit speed?

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

Current Time: Wed Oct 08 19:34:17 PDT 2025

Total time taken to generate the page: 0.00391 seconds