TextBox.st
changeset 1654 790df576b51b
parent 1555 333b639caa8a
child 2088 c8a9d7712cc2
--- a/TextBox.st	Mon Jan 17 12:15:23 2000 +0100
+++ b/TextBox.st	Sat Jan 22 23:02:53 2000 +0100
@@ -84,6 +84,26 @@
 "
 ! !
 
+!TextBox class methodsFor:'common dialogs'!
+
+openOn:someText
+    "open a textBox on some text, 
+     return (the possibly modified) text if accepted; nil otherwise."
+
+    |box returnValue|
+
+    box := self new.
+    box title:'Text'.
+    box initialText:someText.
+    box action:[:text | returnValue := text].
+    box showAtPointer.
+    ^ returnValue.
+
+    "
+     TextBox openOn:'hello'
+    "
+! !
+
 !TextBox class methodsFor:'defaults'!
 
 defaultExtent
@@ -173,5 +193,5 @@
 !TextBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/TextBox.st,v 1.14 1999-09-22 16:25:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/TextBox.st,v 1.15 2000-01-22 22:02:53 cg Exp $'
 ! !