Writing the script
Now you should be able to write a script to use in an event-to-script connection for the Draw push button's clicked event.
The following is the final script that you need:
setParameters
| ps rows array i |
"parm 1 - presentation space handle"
ps := (self subpartNamed: 'Form1')
widget osWidget handle getDc.
(self subpartNamed: 'C External function1')
valueOfAttributeNamed: 'hdc'
selector: #'IS_hdc'
ifAbsent: []
put: (ps asInteger).
"parm 2 - number of points"
rows := (self subpartNamed: 'Ordered Collection1').
(self subpartNamed: 'C External function1')
valueOfAttributeNamed: 'numPoints'
selector: #'IS_numPoints'
ifAbsent: []
put: (rows size).
"parm 3 - the array of points"
array := (self subpartNamed: 'C External function1')
valueOfAttributeNamed: 'lppt'
selector: #'IS_lppt'.
i := 1.
rows do: :each |
(array at: i) at: #x put: (each x asInteger).
(array at: i) at: #y put: (each y asInteger).
i := i + 1].
Connect the Draw push button's clicked event to your setParameters script. Then, connect the Draw push button's clicked event to the execute action of the external function part.
Your final connections should look like the following:
Simple Chart
You can now test your visual part.
Last modified date: 06/11/2018