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

Home » Public Forums » archive » Re: Widgets: group leader and procedures
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: Widgets: group leader and procedures [message #37519] Tue, 06 January 2004 20:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jeff Guerber writes:

> I disagree: If you use a pointer for the widget state, you can change
> its contents and not have to worry about stuffing it back into the uvalue
> before you exit the event handler. Plus you won't be constantly making
> copies of everything in your state structure, which can be an advantage if
> it's large. Just remember to have the TLB's cleanup routine free pstate
> (I call it statep, myself). After I started writing widgets, I very
> quickly switched over to state pointers (until I discovered object
> widgets, that is!).

If you are going to the trouble of putting it back
in the UValue of the TLB, then a simple NO_COPY
will prevent any copying of the state structure
as you move it into and out of an event handler.

I personally prefer to write the NO_COPYs for
simple programs rather than deal with the cumbersome
pointer syntax. But there are distinct advantages to
a pointer in more complicated programs where the state
structure sometimes has to be passed around to programs
outside the confines of the normal single widget program.

But if the pointer syntax doesn't push a user quickly to
object widgets, then the user has a LOT more patience than
I have. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: MODIS L1B - 250m
Next Topic: Re: Sending data to the serial port (Linux)?

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

Current Time: Sat Oct 11 04:25:32 PDT 2025

Total time taken to generate the page: 1.20188 seconds