factor/basis/ui/gadgets/buttons/buttons-tests.factor

43 lines
838 B
Factor
Raw Normal View History

2008-03-01 17:00:45 -05:00
IN: ui.gadgets.buttons.tests
2007-09-20 18:09:08 -04:00
USING: ui.commands ui.gadgets.buttons ui.gadgets.labels
ui.gadgets tools.test namespaces sequences kernel models ;
2007-09-20 18:09:08 -04:00
TUPLE: foo-gadget ;
: com-foo-a ;
: com-foo-b ;
\ foo-gadget "toolbar" f {
{ f com-foo-a }
{ f com-foo-b }
} define-command-map
T{ foo-gadget } <toolbar> "t" set
[ 2 ] [ "t" get gadget-children length ] unit-test
2008-07-11 14:49:00 -04:00
[ "Foo A" ] [ "t" get gadget-child gadget-child label-string ] unit-test
2007-11-14 16:35:17 -05:00
[ ] [
2 <model> {
{ 0 "atheist" }
{ 1 "christian" }
{ 2 "muslim" }
{ 3 "jewish" }
} <radio-buttons> "religion" set
] unit-test
2007-12-26 22:16:14 -05:00
\ <radio-buttons> must-infer
2007-11-16 01:19:13 -05:00
2007-12-26 22:16:14 -05:00
\ <toggle-buttons> must-infer
2007-11-16 01:19:13 -05:00
2007-12-26 22:16:14 -05:00
\ <checkbox> must-infer
2007-11-16 01:19:13 -05:00
2007-11-14 16:35:17 -05:00
[ 0 ] [
"religion" get gadget-child radio-control-value
] unit-test
[ 2 ] [
"religion" get gadget-child control-value
] unit-test