From 44420f200a64d18a3bef9ec40e39dc35da79ca65 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 8 Feb 2005 01:10:02 +0000 Subject: [PATCH] checkboxes --- examples/gadget-test.factor | 13 +++++-------- library/test/gadgets.factor | 8 ++++++++ library/ui/buttons.factor | 32 ++++++++++++++++++++++++++------ library/ui/shapes.factor | 10 ++++++---- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/examples/gadget-test.factor b/examples/gadget-test.factor index e5ec68d99b..859a20e1a4 100644 --- a/examples/gadget-test.factor +++ b/examples/gadget-test.factor @@ -42,20 +42,17 @@ USE: words [[ [ button-up 1 ] [ my-hand shape-x my-hand shape-y pick move-gadget world get add-gadget ] ]] }} swap set-gadget-gestures ; +: filled? "filled" get checkbox-selected? ; + : - dup moving-actions ; + filled? [ ] [ ] ifte dup moving-actions ; : - dup moving-actions ; + filled? [ ] [ ] ifte dup moving-actions ; : dup moving-actions ; -: check-box ( label -- checkbox ) - 0 0 0 0 - [ >r