[Newbies] Drag and dropped jpg (playing cards) - how to put in the "new morph" menu and create a PlayingCard class?

Tobias Pape Tobias_Pape at gmx.de
Sun Oct 25 14:08:10 UTC 2009


Hello —,
Am 2009-10-25 um 07:29 schrieb Mike Stramba:

> I'm runninng squeak 3.10.2 on windows XP.
>
> If I drag and drop a jpg onto Squeak, it creates a SketchMorph.

That ought to be right.

>
> Specficially, I'm adding a playing card image, well 52 of them, and
> I'd like to be able to add a card from the world menu / new morph
> menu.
>
> I'd also like to create a PlayingCard class, that uses the dropped  
> jpg.

Do you really want to create the card from _dropped_ images?
Or do you rather just want to create/reuse images (i.e., not necessarily
dropped ones)?
>
> At the moment I'm doing it the "hard way", after dropping the jpg, I'm
> digging through system dictionary, digging out the world objects, and
> "drilling down" to the dropped object.

I would use the Halo of that image to reach the actual image.
But if I do want to use Images regularly, I actualy store their Forms.
(see wiki.squeak.org/squeak/697 and your image)
To not every time create new forms, I create them once and then store  
them.
Actually, I convert an image to its base64 form, sotr this string  
inside the image
and have its Form created on Demand and then cached.

Hope that helps.

Have a nice Sunday,
	-Tobias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: Signierter Teil der Nachricht
Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091025/035cb158/PGP.pgp


More information about the Beginners mailing list