OSDN Git Service

Enable to track git://github.com/monaka/binutils.git
[pf3gnuchains/pf3gnuchains3x.git] / itcl / itk / examples / TextInfo.itk
diff --git a/itcl/itk/examples/TextInfo.itk b/itcl/itk/examples/TextInfo.itk
new file mode 100644 (file)
index 0000000..ddfcebb
--- /dev/null
@@ -0,0 +1,46 @@
+# ----------------------------------------------------------------------
+#  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
+}