#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Mon, 20 Aug 2018 08:16:35 +0200
changeset 6395 88ef37d43c52
parent 6394 73b674d9c5af
child 6396 0263fa4eae4a
#FEATURE by cg class: DialogBox class added: #request:initialAnswer:list:title:
DialogBox.st
--- a/DialogBox.st	Fri Aug 17 17:29:51 2018 +0200
+++ b/DialogBox.st	Mon Aug 20 08:16:35 2018 +0200
@@ -4616,6 +4616,41 @@
     "Modified: / 5.5.1999 / 10:53:45 / cg"
 !
 
+request:aString initialAnswer:initial list:aList title:titleString
+    "launch a Dialog, which allows user to enter something,
+     or select from a list of values.
+     Return the entered string (may be empty string) or nil (if cancel was pressed)"
+
+    ^ self 
+        request:aString 
+        displayAt:nil 
+        centered:(ForceModalBoxesToOpenAtCenter ? false) 
+        action:nil 
+        initialAnswer:initial
+        okLabel:nil 
+        cancelLabel:nil 
+        title:titleString 
+        onCancel:nil
+        list:aList
+        initialSelection:nil
+        entryCompletionBlock:nil
+
+    "
+     Dialog 
+         request:'Enter a string:' 
+         initialAnswer:'the default'  
+         list:#('foo' 'bar' 'baz')  
+    "
+    "
+     Dialog 
+         request:'enter a string:' 
+         initialAnswer:'the default'  
+         list:((1 to:30) collect:[:i | i printString])  
+    "
+
+    "Created: / 19-08-2018 / 12:20:25 / Claus Gittinger"
+!
+
 request:aString initialAnswer:initial okLabel:okLabel title:titleString 
     "launch a Dialog, which allows user to enter something.
      Return the entered string (may be empty string)