# ----------------------------------------------------------------------
#  EXAMPLE: using mega-widgets as components
# ----------------------------------------------------------------------
#  COURSE:  Object-Oriented Programming with [incr Tcl]
#  AUTHOR:  Michael J. McLennan, Bell Labs Innovations
# ======================================================================
#               Copyright (c) 1996  Lucent Technologies
# ======================================================================

option add *TextInfo.title "Text" widgetDefault

class TextInfo {
    inherit Info

    constructor {args} {
        itk_component add textArea {
            TextDisplay $itk_interior.txt -scrollbar auto
        } {
            usual
            keep -wrap -tabs
            rename -font -textfont textFont Font
        }
        pack $itk_component(textArea) -expand yes -fill both

        eval itk_initialize $args
    }

    public method display {args} {
        eval $itk_component(textArea) display $args
    }

    public method append {args} {
        eval $itk_component(textArea) append $args
    }
}

usual TextInfo {
    keep -background -cursor -foreground -font
    keep -activebackground -activeforeground -activerelief
    keep -disabledforeground
    keep -highlightcolor -highlightthickness
    keep -insertbackground -insertborderwidth -insertwidth
    keep -insertontime -insertofftime
    keep -selectbackground -selectborderwidth -selectforeground
    keep -textbackground -troughcolor
}
