 : <button> ( label quot -- button )
     button new-button ;
 
-TUPLE: button-paint plain rollover pressed selected ;
-
-C: <button-paint> button-paint
+TUPLE: button-pen
+plain rollover
+pressed selected pressed-selected ;
+
+C: <button-pen> button-pen
 
 : find-button ( gadget -- button )
     [ button? ] find-parent ;
 
-: button-paint ( button paint -- button paint )
+: button-pen ( button pen -- button pen )
     over find-button {
+        { [ dup [ pressed?>> ] [ selected?>> ] bi and ] [ drop pressed-selected>> ] }
         { [ dup pressed?>> ] [ drop pressed>> ] }
         { [ dup selected?>> ] [ drop selected>> ] }
         { [ dup button-rollover? ] [ drop rollover>> ] }
         [ drop plain>> ]
     } cond ;
 
-M: button-paint draw-interior
-    button-paint dup [ draw-interior ] [ 2drop ] if ;
-
-M: button-paint draw-boundary
-    button-paint dup [ draw-boundary ] [ 2drop ] if ;
-
-M: button-paint pen-pref-dim
+M: button-pen draw-interior
+    button-pen dup [ draw-interior ] [ 2drop ] if ;
+
+M: button-pen draw-boundary
+    button-pen dup [ draw-boundary ] [ 2drop ] if ;
+
+M: button-pen pen-pref-dim
     [
         {
             [ plain>> pen-pref-dim ]

    hand-clicked get-global child? ;

: button-update ( button -- )
    dup mouse-clicked?
    over button-rollover? and
    buttons-down? and
    >>pressed?
    relayout-1 ;

    #! the mouse is held down.
    repeat-button new-button bevel-button-theme ;

: <checkmark-paint> ( -- pen )
    "checkbox" theme-image <image-pen>
    "checkbox" theme-image <image-pen>
    "checkbox-clicked" theme-image <image-pen>
    "checkbox-set" theme-image <image-pen>
    "checkbox-set-clicked" theme-image <image-pen>
    <button-pen> ;

: <checkmark> ( -- gadget )
    <gadget>
    <checkmark-paint> >>interior
    dup dup interior>> pen-pref-dim >>dim ;

: toggle-model ( model -- )
    [ not ] change-model ;
