Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Programming morphs - page 9 - user queries
Last updated at 10:32 pm UTC on 12 June 2018
Finally, it is often useful to ask the user for a small amount of information before proceding.

The simplest way to ask is to pop up a text window and ask the user to submit a response. This can be done using class FillInTheBlank:

	FillInTheBlank request: 'What is your name?' initialAnswer: 'Jean'


Often, instead of requiring a user to type in a text response, it is possible to let them choose from all possible alternatives in a menu. There are many varieties of menus in Squeak; one of the simplest is the PopUpMenu, which is used as below:

menu :=
PopUpMenu
labelArray: #(
'red'
'blue'
'green'
'cyan'
'magenta'
'yellow'
'white'
'black')
lines: #(3 6 8).
menu startUpWithCaption: 'Pick a color' 6