+addTextLabelOn:
authorClaus Gittinger <cg@exept.de>
Mon, 07 Sep 2009 11:34:45 +0200
changeset 3908 172d2e8ad328
parent 3907 e4be6bf71a98
child 3909 373f8a5ba609
+addTextLabelOn:
DialogBox.st
--- a/DialogBox.st	Fri Sep 04 14:23:09 2009 +0200
+++ b/DialogBox.st	Mon Sep 07 11:34:45 2009 +0200
@@ -6394,6 +6394,36 @@
     "
 !
 
+addTextLabelOn:aValueHolder
+    "create a text label showing the contents of a valueHolder.
+     Returns the label."
+
+    |l|
+
+    l := Label new labelChannel:aValueHolder.
+    l borderWidth:0.
+    self addComponent:l.
+    ^ l
+
+    "
+     |b|
+
+     b := DialogBox new.
+     b addTextLabelOn:'hello' asValue.
+     b showAtPointer
+    "
+    "
+     |b|
+
+     b := DialogBox new.
+     b leftIndent:100.
+     b addTextLabelOn:'hello' asValue.
+     b leftIndent:0.
+     b addTextLabelOn:'world' asValue.
+     b showAtPointer
+    "
+!
+
 addToInputFieldGroup:aComponentOrSubcomponent
     "add a component to the input group.
      The argument, aComponentOrSubcomponent may even be a nested subcomponent of
@@ -8831,7 +8861,7 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.285 2009-09-04 09:22:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.286 2009-09-07 09:34:45 cg Exp $'
 ! !
 
 DialogBox initialize!