Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
FillInTheBlankMorph
Last updated at 4:52 pm UTC on 16 January 2006
The FillinTheBlankMorph presents a text entry box to the user along with a title and Accept and Cancel buttons. There are many variations including some not shown below.

Show the morph with its title. Answer the information typed if Accept is pressed or an empty string if Cancel is pressed.
FillInTheBlankMorph request: 'What is your name?'

"As above, but a default answer can be specified."
FillInTheBlankMorph
		request: 'What is your favorite color?'
		initialAnswer: 'red'

"As above but the morph is placed at the display center."
FillInTheBlankMorph
		request: 'What is your favorite color?'
		initialAnswer: 'red'
		centerAt: Display center

Capturing a password Show the morph with its title. Answer the information typed if Accept is pressed or an empty string if Cancel is pressed. The display shows asterisks for each character typed, but the answer contains the actual text that was typed.
FillInTheBlankMorph requestPassword: 'Enter the current password'

"As above, but the morph is placed at the display center, default password supplied and a carriage return dismisses the dialog."
FillInTheBlankMorph
	request: 'Enter Information'
	initialAnswer: 'asdf'
	centerAt: Display center 
	inWorld: World 
	onCancelReturn: nil
	acceptOnCR: false

"As above, but a carriage return dismisses dialog and accepts the results."
FillInTheBlankMorph
	requestPassword: 'Enter Password'
	initialAnswer: 'asdf'
	centerAt: Display center 
	inWorld: World 
	onCancelReturn: nil
	acceptOnCR: true