User input/Graphical: Difference between revisions
Content added Content deleted
(A CL entry using LispWorks & CAPI) |
(A J language example of GUI) |
||
Line 246: | Line 246: | ||
:value-function 'string/integer-prompt-value |
:value-function 'string/integer-prompt-value |
||
:ok-check #'(lambda (result) (eql (cdr result) 75000))))</lang> |
:ok-check #'(lambda (result) (eql (cdr result) 75000))))</lang> |
||
=={{header|J}}== |
|||
A revision of the script posted at the [http://www.jsoftware.com/jwiki/Grid/Examples#griddemo2.ijs J wiki] |
|||
<lang j> |
|||
quote =: ''''&,@(,&'''') |
|||
assign=: [,'=:',quote@] |
|||
execute=: ".@: assign &":&>/ NB. see gdemo_savegrid_button |
|||
require 'jzgrid' |
|||
cocurrent 'myform' |
|||
CELLDATA=: _2]\4{.'String';'Number';' ';75000 |
|||
GDEMO=: 0 : 0 |
|||
pc gdemo; |
|||
xywh 6 6 98 12;cc savegrid button;cn "Save after <Return>"; |
|||
xywh 0 25 200 100;cc grid isigraph rightmove bottommove; |
|||
pas 0 0; |
|||
rem form end; |
|||
) |
|||
gdemo_run=: 3 : 0 |
|||
wd GDEMO |
|||
grid=: '' conew 'jzgrid' |
|||
show__grid 'celldata' |
|||
wd 'pshow' |
|||
) |
|||
create=: gdemo_run |
|||
destroy=: 3 : 0 |
|||
destroy__grid'' |
|||
wd 'pclose' |
|||
codestroy'' |
|||
) |
|||
gdemo_savegrid_button=: 3 : 0 |
|||
GRID_base_=: CELLDATA__grid |
|||
execute_base_ GRID_base_ |
|||
) |
|||
gdemo_close=: destroy |
|||
create'' |
|||
</lang> |
|||
After you enter values into the graphical display and click "Save", then you |
|||
can bring focus to the .ijx window to see results. If you did not change the names "String" |
|||
and "Number", then you can type "String 'return'" and "Number 'return'" into |
|||
the .ijx window to verify their values. If you changed the names, then the |
|||
values will be at the revised names. |
|||
=={{header|Java}}== |
=={{header|Java}}== |