! Copyright (C) 2005, 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays hashtables io kernel math namespaces opengl sequences strings splitting ui.gadgets ui.gadgets.tracks ui.gadgets.theme ui.render colors models ; IN: ui.gadgets.labels ! A label gadget draws a string. TUPLE: label text font color ; : label-string ( label -- string ) text>> dup string? [ "\n" join ] unless ; inline : set-label-string ( string label -- ) CHAR: \n pick memq? [ >r string-lines r> set-label-text ] [ set-label-text ] if ; inline : label-theme ( gadget -- gadget ) sans-serif-font >>font black >>color ; inline :