[Newbie] Project design problem

Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Sun Oct 2 08:51:06 UTC 2005


Charles Hixson puso en su mail :

> If I could read in an image and place it into a button, then I could do
> a straight translation.  But would this be the proper approach?  I
> thought I might find the proper approach by studying the code for the
> FreeCell game, as in many ways it appears to be a similar problem, but
> the approach they take appears to be drawing the images on the fly, and
> the thought of trying to program the drawing of bass and treble signs
> fills me with such trepidation that I feel this MUST be the wrong approach.

Besides Karl and Stephane advice:

f _ Form fromFileNamed: 'YouFile.xxx'. "select the proper path. Graphic
files could be .gif, png, .jpg"
esteBoton _ IconicButton new. "Create  instance of IconicButton "

esteBoton labelGraphic: f. "now the button have your graphic "
esteBoton openInWorld.

You could have a Dictionary with names and pictures as:
 musicDuration := Dictionary new.
 musicDuration  at: #whole put: aIconicButton.
 musicDuration  at: #half put: aIconicButton.
musicDuration  at: #quarter put: aIconicButton.

Naturally, the instances should match the right picture.

I glad to assist if you need/wish, I on Squeak now.

Edgar



	

	
		
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 




More information about the Squeak-dev mailing list