[ENH] Sketch to Background

Joshua Gargus gargus at cs.ualberta.ca
Wed May 3 06:57:32 UTC 2000


Adds a menu item to SketchMorph to allow you to use it 
as the World's background.  Move the code to set the 
background from FileList into Form so that both FileList
and SketchMorph can use it.

-------------- next part --------------
'From Squeak2.8alpha of 19 January 2000 [latest update: #2052] on 3 May 2000 at 12:56:30 am'!
"Change Set:		SketchToBackground
Date:			3 May 2000
Author:			Joshua Gargus

Adds a menu item to SketchMorph to allow you to use it as the World's background.  Move the code to set the background from FileList into Form so that both FileList and SketchMorph can use it."!


!FileList methodsFor: 'file list menu' stamp: 'jcg 5/1/2000 23:09'!
openAsBackground
	"Set an image as a background image. Support Squeak's common file format (GIF, JPG, Form stoteOn: (run coded) and BMP)"

	(Form fromFileNamed: self fullName) setAsBackground.
! !


!Form methodsFor: 'displaying' stamp: 'jcg 5/1/2000 23:08'!
setAsBackground
	"Set this form as a background image."

	World
     	ifNil: [ScheduledControllers screenController model form: self. 
             	Display restoreAfter: [].]
     	ifNotNil: [World color: (InfiniteForm with: self)].! !


!SketchMorph methodsFor: 'menu' stamp: 'jcg 5/1/2000 23:1!
2'!
addCustomMenuItems: aCustomMenu hand: aHandMorph
	super addCustomMenuItems: aCustomMenu hand: aHandMorph.
	aCustomMenu add: 'choose new graphic...' target: self action: #chooseNewGraphic.
	aCustomMenu add: 'set as background' target: rotatedForm action: #setAsBackground.
	self addPaintingItemsTo: aCustomMenu hand: aHandMorph
! !


More information about the Squeak-dev mailing list