/component superclass /PaintButton { % boolean -- {BG2} {BG} ifelse setcolor 0 0 w h rectpath fill FG setcolor 0 [0 0 w h] insetstroke aload pop rectpath stroke } def /Paint { % -- false PaintButton } def /trackinpath false def /trackbutton { % -- trackx tracky pointinpath dup trackinpath ne { dup /trackinpath exch promote gsave newpath [exch] /PaintButton self Send grestore } {pop} ifelse } def /OnSelect { % -- path /trackbutton track trackinpath { newpath /mouse_cancel ne { [false] /PaintButton self Send action } if } {pop} ifelse /trackinpath unpromote } def