Re: Beginner going INSANE [message #21787] |
Thu, 21 September 2000 00:00 |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
Woo-Hoo! I am off the hook :-)
Thanks, Angela!
Cheers,
Pavel
P.S. Lets' just say that I was about to learn PV-Wave, but feel a lot
better that I don't have to :-)
|
|
|
Re: Beginner going INSANE [message #21796 is a reply to message #21787] |
Thu, 21 September 2000 00:00  |
angerelle
Messages: 1 Registered: September 2000
|
Junior Member |
|
|
There are PV-WAVE users out here! We're just not all working in US
timezones!
I've knocked up a quick example for two text boxes using common blocks
to pass around the array that needs to be changed plus the widget ids so
that I can switch on wid to work out which element to set.
---------8<-----beginnerwidget.pro -------------
PRO get_data_cb, wid, data
COMMON Stored, data_store, text0, text1
; need to have common block with array that we want to alter, and all
; of the widget ids for the text boxes. After this first declaration
; the size of the common block can't grow, so make sure that you've
; got everything you want in here, because common blocks are
; persistent during the whole of a PV-WAVE session!
; Get the typed text, should probably do some type checking
; (with SIZE for example) to check that it's suitable for your array
value = WwGetValue(wid)
; Switch on wid to find out which text box was set, and change
; appropriate array element
CASE wid OF
text0: data_store(0) = value
text1: data_store(1) = value
ELSE: ; do nothing
ENDCASE
; data_store should have been changed!
PRINT, data_store
END
PRO Beginnerwidget
COMMON Stored, data_store, text0, text1
; any old numbers to make it easy
data_store = INDGEN(12)
top = WwInit('test', 'test', layout, /form)
text0 = WwText(layout, 'get_data_cb', cols = 10, /left, /top, $
label="data_store(0)")
text1 = WwText(layout, 'get_data_cb', cols = 10, top=text0, /left, $
label="data_store(1)")
status = WwSetValue(top, /Display)
WwLoop
END
-------------------------8<---------------
Hope this helps,
Angela
> My first thought on reading this question was that
> this would certainly flush all the PV-Wave users
> out of hiding. But now, seeing that Andy has had
> to reply three times to his own post, I'm not sure
> there *are* any PV-Wave users in hiding. :-(
>
> Perhaps it's time we voted to change the name
> of this group. Since the Cobra people left, we
> can probably get the old comp.lang.idl name
> back for a song. :-)
>
Sent via Deja.com http://www.deja.com/
Before you buy.
|
|
|
Re: Beginner going INSANE [message #21799 is a reply to message #21787] |
Thu, 21 September 2000 00:00  |
Andy[1]
Messages: 5 Registered: September 2000
|
Junior Member |
|
|
"How exactly are you passing the contents of the data entry fields from the
widget to the
main routine?"
I'm not, thats the bit I cant do.. haha
as well as not being able to make the program differentiate between which
variable it is actually updating..
andy
|
|
|
Re: Beginner going INSANE [message #21802 is a reply to message #21787] |
Wed, 20 September 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Andy (andymcfee@andymcfee.plus.com) writes:
> this will probably be an easy question for all you experts out there but its
> got me beat -
>
> I have been given a PV-WAVE program that simulates a certain lab experiment.
> The variables for this sim
> are defined in the source code and my mission is to add a user interface
> using PV-WAVE widgets that allows a user to change these variables on screen
> before running the simulation.
My first thought on reading this question was that
this would certainly flush all the PV-Wave users
out of hiding. But now, seeing that Andy has had
to reply three times to his own post, I'm not sure
there *are* any PV-Wave users in hiding. :-(
Perhaps it's time we voted to change the name
of this group. Since the Cobra people left, we
can probably get the old comp.lang.idl name
back for a song. :-)
Anyway, I don't know jack about PV-Wave anymore.
But I do remember looking at the widget interface
once and thinking, "Wow. This is sure more complicated
than IDL!" (I'm sure it is *much* more sophisticated,
however.) In any case, I don't remember seeing any
way to pass something like an info structure around
in widget programs. I suspect that data has to be
passed in Common blocks.
But, as I say, I really don't know the first thing
about it. I just feel badly that someone is suffering
mental health problems and we just all stand around
gawking. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Beginner going INSANE [message #21804 is a reply to message #21802] |
Wed, 20 September 2000 00:00  |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
I don't belong to "experts" and use IDL, not PV-WAVE, but if you posted
a little more detailed description of *how* you are redefining the data
array it probably would make it easier to help you. How exactly are you
passing the contents of the data entry fields from the widget to the
main routine?
Cheers,
Pavel
|
|
|