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

Home » Public Forums » archive » Re: pState structure without widgets?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: pState structure without widgets? [message #60378] Wed, 14 May 2008 15:58
Robbie is currently offline  Robbie
Messages: 165
Registered: February 2006
Senior Member
I have resorted to writing "widget methods" which take the first
argument as the pState. For example:

mywidget_build, pState
mywidget_show, pState

I used pass around the widget id, until I encountered issues when
attempting to unpack the UVALUE twice. To be completely safe, pState
should be a pointer to a structure. By the time you've done everything
the *right* way, you might as well just use objects.

Compare the syntax of these two statements

data = *(*pState).pData

data = *self.pData

Which statement makes more sense to you?


Robbie
Re: pState structure without widgets? [message #60406 is a reply to message #60378] Tue, 13 May 2008 08:32 Go to previous message
Gianluca Li Causi is currently offline  Gianluca Li Causi
Messages: 21
Registered: August 2005
Junior Member
On May 13, 4:48 pm, David Fanning <n...@dfanning.com> wrote:
> Gianluca Li Causi writes:
>> I'm developing an application that should be used in widget-mode as
>> well as in non-widget-mode, basing on the user's choice.
>
>> As usual, I'm using the pState structure to communicate between widget
>> functions and store widget's values, but how can I still use this
>> variable in the non-widget-mode?
>
>> I've originally coded the program in widget-mode, now I would try to
>> make it work in non-widget-node without to re-write the full code....
>
>> Could someone help?
>
> Probably not, since I lack the imagination to even think how
> this could even happen. :-)
>
> I'd write the darn thing as an object, though, with
> a GUI method for displaying the widget part of the
> program. Your pState structure then becomes the
> object member data, and you can use the program with
> or without a graphical front end.
>
> Cheers,
>
> David

I see, you're right that I must fully separate graphical front end
from the rest of the code, nd this can be well done only with object
coding...

Thanks
Gianluca
Re: pState structure without widgets? [message #60409 is a reply to message #60406] Tue, 13 May 2008 07:48 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Gianluca Li Causi writes:

> I'm developing an application that should be used in widget-mode as
> well as in non-widget-mode, basing on the user's choice.
>
> As usual, I'm using the pState structure to communicate between widget
> functions and store widget's values, but how can I still use this
> variable in the non-widget-mode?
>
> I've originally coded the program in widget-mode, now I would try to
> make it work in non-widget-node without to re-write the full code....
>
> Could someone help?

Probably not, since I lack the imagination to even think how
this could even happen. :-)

I'd write the darn thing as an object, though, with
a GUI method for displaying the widget part of the
program. Your pState structure then becomes the
object member data, and you can use the program with
or without a graphical front end.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: how to "check" checkbox state?
Next Topic: strange behaviour of .skip command

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

Current Time: Thu Oct 09 21:19:02 PDT 2025

Total time taken to generate the page: 0.48306 seconds