In general you should never use wd'q'. wdhandler does a wd'q' automatically
for you whenever an event occurs and all the event data is set.
----- Original Message -----
From: "Robert O'Boyle" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, March 10, 2008 8:25 PM
Subject: [Jprogramming] Forms and Plots again
I have made a bit of progress since my last e-mail with trying to develop
an
interactive plot using the Form Editor but am stalled on a domain error.
According to the Window Controls in the User on-line documentation, 'set
id
a b c d' should allow me to set the left, middle and right positions of
the
scrollbar as well as the step size in pixels. I should then be able to
retrieve the position of the scrollbar slider with wd 'q'. At least this
is
how I am interpreting it. I'm new to all this so I could have it wrong on
a
number of levels.
My script is below. The domain error occurs with the set parameter in the
GRAPH script. I can't see where the error is.
Any help would be greatly appreciated
Bob
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------------------
GRAPH =: 0 : 0
pc graph;pn "Graph Generator";
menupop "File";
menu new "&New" "" "" "";
menu open "&Open" "" "" "";
menusep;
menu exit "&Exit" "" "" "";
menupopz;
xywh 12 3 44 12;cc ok button;cn "OK";
xywh 265 2 44 12;cc cancel button;cn "Cancel";
xywh 23 256 50 10;cc values static ss_center;
xywh 21 23 281 221;cc chart isigraph ws_border;
xywh 54 255 177 11;cc aparm scrollbar;
set aparm 100 150 200 5
pas 20 20;pcenter;
rem form end;
)
graph_setup =: 3 : 0
wd GRAPH
charthandle =: wd 'qhwndc chart'
require 'gl2'
coinsert 'jgl2'
wd 'pshow;'
)
graph_close=: 3 : 0
wd'pclose'
)
graph_cancel_button=: 3 : 0
graph_close''
)
graph_ok_button=: 3 : 0
wdinfo 'OK button pressed'
)
graph_chart_char=: 3 : 0
glsel charthandle
glclear''
glrgb 255 0 0
glpen 2, PS_DASH
gllines mat%10
glpaint''
)
graph_aparm_button =: 3 : 0
a =: ". wd 'q'
wd 'set values *','A = ',": a+0.25
b=: 0.00033
ssb=: ((i. 20)*500)%2
rec=: a*ssb*^-b*ssb
mat=: ,ssb,.rec
graph_chart_char''
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm