[ENH] Block monitor (was: The buttonizer +3)

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Wed Jan 19 08:40:06 UTC 2000


On Tue, 18 Jan 2000 ssadams at us.ibm.com wrote:

> Here is an enhancement that I've wanted for a long time.  Its a menu
> item that takes the selected code in a text pane and makes a button
> for it on the desktop (MVC or Morphic).

This reminds me of another little Morphic tool: UpdatingStringMorph is a
great thing to monitor something. With this helper method you can do
	[Time now] monitor
or
	[Smalltalk primBytesLeft] monitor

-----------------------
!BlockContext methodsFor: 'evaluating' stamp: 'bf 1/19/2000 09:35'!
monitor
	"Interactive. Morphic only.
	Make an UpdatingStringMorph that shows the result of evaluating me three times a second.
	Example: ([Smalltalk primBytesLeft] monitor)"

	Smalltalk isMorphic ifTrue: [
		Smalltalk at: #UpdatingStringMorph ifPresent: [:usm |
			^World currentHand attachMorph:
				((usm on: self selector: #value)
					stepTime: 333;
					openInWorld)]].
	self error: 'This only works in Morphic'! !
-----------------------

  -Bert-






More information about the Squeak-dev mailing list