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 #37520 is a reply to message #37519] Tue, 06 January 2004 19:56 Go to previous messageGo to previous message
Jeff Guerber is currently offline  Jeff Guerber
Messages: 41
Registered: July 2000
Member
On Sun, 4 Jan 2004, Robert Moss wrote:

> A bit of unsolicited advice: you had the following:
>
> state={ bunch of stuff}
> pstate = Ptr_new(state, /no_copy)
> widget_control, tlb, set_uvalue = pstate
>
> I would do this instead:
>
> state = {bunch of stuff}
> widget_control, tlb, set_uvalue = state, /no_copy
>
> There is no real need to stuff your entire widget state into a pointer.

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!).

Jeff Guerber
[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 12:31:10 PDT 2025

Total time taken to generate the page: 1.04287 seconds