1 USING: accessors arrays kernel math.rectangles sequences
2 ui.gadgets.controls models.combinators ui.gadgets ui.gadgets.glass
3 ui.gadgets.labels ui.gestures ;
4 QUALIFIED-WITH: ui.gadgets.tables tbl
5 IN: ui.gadgets.comboboxes
7 TUPLE: combo-table < table spawner ;
9 M: combo-table handle-gesture [ call-next-method drop ] 2keep swap
12 [ tbl:selected-row [ swap set-control-value ] [ 2drop ] if ]
16 TUPLE: combobox < label-control table ;
18 { T{ button-down } [ dup table>> over >>spawner <zero-rect> show-glass ] }
21 : <combobox> ( options -- combobox ) [ first [ combobox new-label ] keep <basic> >>model ] keep
22 <basic> combo-table new-table [ 1array ] >>quot >>table ;