このコードを使用して、特定の場所からマウスの場所までの線を作成しています。クリックした後、この行を削除しようとしていますが、クリックした後にライブを削除する方法がわかりません。何を変更すればよいですか?
stk:= (LineMorph from: 100@100 to: 1300@1300 color: Color red width: 2) openInWorld.
handle := HandleMorph new forEachPointDo: [:newPoint | stk setVertices: {whiteBallinHole position. (newPoint-(10@10)). }.
stk on: #mouseDown send: #value: to:[:evt|
evt redButtonPressed ifTrue:[ self handlesMouseDown: evt.
「マウスがクリックした後にスティックを削除してください。これは機能しません。助けてください」
stk color: Color transparent.
stk delete.
""
].
].
].
" (self currentHand attachMorph: handle)."
" self currentHand addMorph:handle. "
self currentHand attachMorph:handle.