In reply to jaleco:
Well, first thing to check is that the bindkeys for Enter and double click left mouse are set, but assuming they are, I suspect it's probably because you're not using a ?doneProc with enterPoints and have "Repeat Commands" set in the Options->Editor form.
If Repeat Commands is enabled, then the enterPoints() function does not return after you've hit the return key or double-clicked - instead, it goes back to the "first" prompt again and asks again. Since the expected use model with an enterFunction is to use the ?doneProc callback to do the action, this makes sense - as it allows you to repeatedly do the same thing over and over again.
You can observe this by doing:
procedure(MyDoneProc(win ok points) printf("FINISHED: %L %L\n" ok points))enterPoints(?prompts '("first" "next") ?doneProc "MyDoneProc")
You should see the "FINISHED" message when you hit return or double click. Is that happening? Also, the prompt will go back to "first" rather than "next". Then also try turning off Repeat Commands and see what happens.
In reply to Andrew Beckett:
very sorry for the embarrassing long time that has passed while this issue got buried on my end. My problem with the ?doneProc turned out to be a dumb code typo. However, I am still looking into how to manipulate the ?wantPoints and ?points parameters if possible.
Due to the time that has passed since looking at this, I will create a new post if necessary.
Thank you again.
I'm not sure what you're trying to do - the ?wantPoints and ?points are fairly clear in the documentation, so I'm not sure what your issue is.
No problem with continuing through this topic thread, because it's related (and you're the same person!)
I am trying to use a form field to pass a value to ?wantPoints, and to make this dynamic such that if the field value is changed, that ?wantPoints would be updated, but this does not seem to be possible. Once I have begun the enterPoints() function, ?wantPoints is fixed. So the solution to this is to de-couple the form from enterPoints(), using a button to launch enterPoints() once the form field values have been defined (user has a chance to change them). If you know of a better way, please share.
I also got a solution for deleting duplicate points in the points list within the ?addPointsProc, using (surprise) deletePoint(), where I had been trying to manipulate the points list and re-assign it to the form. Reassigning the points list was not working for me. The code below works as the callback for ?addPointProc to delete duplicate points:
procedure(CCSdelPt(win ptList) println(ptList) ptList=reverse(ptList) when(member(car(ptList) cdr(ptList)) deletePoint() ); when); procedure CCSdelPt
I think you'd probably need to use changeEnterFun() to do that (the first thing). But I've not tried...
you were right, I was able to reset ?wantPoints using changeEnterFun().
Could you offer any advice about the ?delPointProc portion of enterPoints()? I don't see how to actually delete, or undo a point while enterPoints is collecting keyboard/mouse entries....I've tried testing with the Escape and Delete keys, and the bindkey for "undo". None seem to trigger the ?delPointProc...
Hit backspace - this is the key normally used to delete a point already entered - and that would delete the last point and trigger the delPointProc.
It corresponds to the deletePoint() function.