[squeak-dev] The Inbox: Morphic-laza.574.mcz

Bert Freudenberg bert at freudenbergs.de
Thu Sep 15 16:40:06 UTC 2011


I like the idea, but not the implementation. I'd rather not fork a process but use Morphic stepping instead. 

Also, I'd have expected this to be "auto cancel" not "auto accept". Maybe we need both?

- Bert -

On 15.09.2011, at 09:16, commits at source.squeak.org wrote:

> Alexander Lazarević uploaded a new version of Morphic to project The Inbox:
> http://source.squeak.org/inbox/Morphic-laza.574.mcz
> 
> ==================== Summary ====================
> 
> Name: Morphic-laza.574
> Author: laza
> Time: 15 September 2011, 11:15:54.794 am
> UUID: d6d493ea-178b-44ca-bb16-46345d84111d
> Ancestors: Morphic-laza.573
> 
> Now with spiffy countdown on the selected button
> 
> UserDialogBoxMorph confirm: 'Yay! This is great!' timeout: 5
> 
> =============== Diff against Morphic-laza.573 ===============
> 
> Item was changed:
>  AlignmentMorph subclass: #UserDialogBoxMorph
> + 	instanceVariableNames: 'titleMorph labelMorph buttonRow value selectedButton selectedButtonLabel cancelButton timeout autoCloseProcess'
> - 	instanceVariableNames: 'titleMorph labelMorph buttonRow value selectedButton cancelButton timeout autoCloseProcess'
>  	classVariableNames: ''
>  	poolDictionaries: ''
>  	category: 'Morphic-Windows'!
> 
>  !UserDialogBoxMorph commentStamp: 'ar 12/11/2009 22:33' prior: 0!
>  A DialogBoxMorph is Morph used in simple yes/no/confirm dialogs. Strongly modal.!
> 
> Item was changed:
>  ----- Method: UserDialogBoxMorph>>autoCloseBlock (in category 'running') -----
>  autoCloseBlock
>  	^[
> + 		| start past |
> + 		start := Time totalSeconds.
> + 		selectedButtonLabel := selectedButton label.
> + 		[(past := Time totalSeconds - start) <= timeout] whileTrue: [
> + 			selectedButton label: selectedButtonLabel, ' (', (timeout - past) printString, ')'.
> + 			(Delay forSeconds: 1) wait].
> - 		(Delay forSeconds: self timeout) wait.
>  		selectedButton ifNotNil: [selectedButton performAction]
>  	]!
> 
> Item was changed:
>  ----- Method: UserDialogBoxMorph>>stopAutoClose (in category 'running') -----
>  stopAutoClose
> + 	autoCloseProcess ifNotNil: [autoCloseProcess terminate].
> + 	selectedButtonLabel ifNotNil: [
> + 		selectedButton label: selectedButtonLabel.
> + 		selectedButtonLabel := nil]!
> - 	autoCloseProcess ifNotNil: [autoCloseProcess terminate]!
> 
> 





More information about the Squeak-dev mailing list