[Etoys] ScriptInstantiation #tickingRate

Ricardo Moran richi.moran at gmail.com
Fri Jan 16 08:08:43 EST 2009

Skipped content of type multipart/alternative-------------- next part --------------
'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 16 January 2009 at 11:01:24 am'!

!ScriptEditorMorph methodsFor: 'buttons' stamp: 'Richo 1/16/2009 10:43'!
	| reply aNumber |
	reply := FillInTheBlank request: 'New ticking rate: ' translated initialAnswer: self scriptInstantiation tickingRate printString.
		ifNotNil: [aNumber := reply asNumber.
			aNumber > 0
				ifTrue: [self setTickingRateTo: aNumber]]! !

!ScriptEditorMorph methodsFor: 'frequency' stamp: 'Richo 1/16/2009 10:43'!
setTickingRateTo: aNumber 
	self scriptInstantiation tickingRate:
	aNumber! !

!ScriptEditorMorph methodsFor: 'other' stamp: 'Richo 1/16/2009 11:00'!
	"Put up a menu in response to the user's clicking in the menu-request
	area of the scriptor's heaer"
	| aMenu count |
	self modernize.
	ActiveHand showTemporaryCursor: nil.
	aMenu := MenuMorph new defaultTarget: self.
	aMenu addTitle: scriptName asString.
	Preferences universalTiles
		ifFalse: [count := self savedTileVersionsCount.
			self showingMethodPane
				ifTrue: ["current showing textual source"
					count >= 1
						ifTrue: [aMenu add: 'revert to tile version' translated action: #revertToTileVersion]]
				ifFalse: ["currently showing tiles"
					aMenu add: 'show code textually' translated action: #showSourceInScriptor.
					count > 0
						ifTrue: [aMenu add: 'revert to tile version...' translated action: #revertScriptVersion].
					aMenu add: 'save this version' translated action: #saveScriptVersion]].
	aMenu addList: {#-. {'destroy this script' translated. #destroyScript}. {'rename this script' translated. #renameScript}}.
	self hasParameter
		ifFalse: [aMenu addList: {{'button to fire this script' translated. #tearOfButtonToFireScript}}].
	aMenu addList: {{'edit balloon help for this script' translated. #editMethodDescription}. #-. {'explain status alternatives' translated. #explainStatusAlternatives}. #-. {'hand me a tile for self' translated. #handUserTileForSelf}. {'hand me a "random number" tile' translated. #handUserRandomTile}. {'hand me a "button down?" tile' translated. #handUserButtonDownTile}. {'hand me a "button up?" tile' translated. #handUserButtonUpTile}}.
		addList: (self hasParameter
				ifTrue: [{#-. {'remove parameter' translated. #ceaseHavingAParameter}}]
				ifFalse: [{{'ticks per second ...' translated. #chooseTickingRate}. {'fires per tick...' translated. #chooseFrequency}. #-. {'add parameter' translated. #addParameter}}]).
	aMenu popUpInWorld: self currentWorld! !

More information about the etoys-dev mailing list