aUCBLogo Demos and Tests / choiceboxtest
be choiceboxtest
thread [cbtest]
end
be cbtest
local [f cb bappend bdelete bs bs2 finish]
f=(Frame [][MyFrame]
wxDefault_Frame_Style+wxStay_on_Top
[400 300][300 100])
FrameOnClose f [finish=true]
cb=ChoiceBox f [MyChoiceBox]
[ [String 1]
[and a second string]
[and the last string]
]
[ (show "MyChoiceBox ChoiceBoxSelection)
]
bappend=Button f [&append item]
[ ChoiceBoxAppend cb se [and another item] gensym
]
bdelete=Button f [&delete last item]
[ if (ChoiceBoxCount cb) > 0
[ ChoiceBoxRemoveItem cb (ChoiceBoxCount cb)-1
]
]
bs=BoxSizer wxVertical
BoxSizerAdd bs cb 1 wxExpand 0
bs2=BoxSizer wxHorizontal
BoxSizerAdd bs2 bappend 1 wxExpand 0
BoxSizerAdd bs2 bdelete 1 wxExpand 0
BoxSizerAdd bs bs2 0 wxExpand 0
FrameSetSizer f bs
FrameSetClientSize f -1 -1
finish=false
until [finish]
[ dispatchMessages
waituS 100000
]
end