Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Capturing a password
Last updated at 11:19 am UTC on 31 March 2017
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