Advice for design of simple program.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Advice for design of simple program.

Blake-5
Hello, all:

        I'm working on a number of Squeak projects but another project has come  
up that I think Squeak would be perfect for and I think I'm best off using  
a mix of the different approaches of Squeak.

        The simplicty of the program is a source list of items that can be  
dragged and dropped into one of a number of baskets elsewhere on the  
field. The items have a point value and each basket shows how many points  
it has. Source items are templates, containing activities like "walk the  
dog" or "fly a kit", so the dragging process creates an instance to be  
dropped into a basket.

        So far, my main Squeak successes have been greatest when using straight  
code. I've been somewhat successful doing some EToys stuff and this looks  
like a situation where it would make sense to mix pre-fabbed morphs with  
code.

        First of all, I find myself confused because I had thought Etoys weren't  
in the latest Squeak (I'm using squeak dev image 93). Isn't Etoys the  
tile-based-viewer-with-scripts thing? 'cause I still have those. But  
beyond that:

        My plan for the source was to populate a TabbedPalette with image+label  
morphs (you know, so an item would have a picture of a dog with the text  
walk-the-dog underneath). The "baskets" would be image+label+number (so, a  
picture with a name and a score). The basket's would have the ability to  
accept a dragged image+label morph. Ultimately, I also need a mechanism  
for the user to add items to the TabbedPalette.

        I pull out a tabbed palette and rename the two starter tabs and try to  
add a third. I can't find any way in any menu or inspector to add another  
tab. I actually end up pulling the inspector for the IndexTab object and  
calling "AddTab". This gives me a tab named "Flash" and the renaming trick  
I used for the other tabs doesn't work, so I end up bringing the inspector  
up for that and changing the name that way.

        Then I put an image up and I don't see any way to change the image. I'm  
sure I can do it through the inspector but I'm beginning to wonder if I'm  
missing something obvious here. Maybe I shouldn't try to incorporate the  
object palettes and just code everything in the usual way.

        Thoughts?
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Advice for design of simple program.

Edgar J. De Cleene



El 3/22/07 1:08 AM, "Blake" <[hidden email]> escribió:

> I find myself confused because I had thought Etoys weren't
> in the latest Squeak (I'm using squeak dev image 93). Isn't Etoys the
> tile-based-viewer-with-scripts thing?
Etoys is on 3.10 alpha, but plan is what we unload once I have time to
complete the Monticello load again stuff and have approved by Ralph.
So , Etoys works as always , if not send mail.

>     My plan for the source was to populate a TabbedPalette with image+label
> morphs (you know, so an item would have a picture of a dog with the text
> walk-the-dog underneath). The "baskets" would be image+label+number (so, a
> picture with a name and a score). The basket's would have the ability to
> accept a dragged image+label morph. Ultimately, I also need a mechanism
> for the user to add items to the TabbedPalette.
>
>     I pull out a tabbed palette and rename the two starter tabs and try to
> add a third. I can't find any way in any menu or inspector to add another
> tab. I actually end up pulling the inspector for the IndexTab object and
> calling "AddTab". This gives me a tab named "Flash" and the renaming trick
> I used for the other tabs doesn't work, so I end up bringing the inspector
> up for that and changing the name that way.
>
>     Then I put an image up and I don't see any way to change the image. I'm
> sure I can do it through the inspector but I'm beginning to wonder if I'm
> missing something obvious here. Maybe I shouldn't try to incorporate the
> object palettes and just code everything in the usual way.
>
>     Thoughts?

What I do if must cook your spec:
Subclass ImageMorph

ImageMorph subclass: #BlakeMorph
instanceVariableNames: 'label number '
classVariableNames: ''
poolDictionaries: ''
category: 'BlakeStuff'

initialize
super initialize.
self image: Form fromFileNamed: "your path here or could use FillInTheBlank
for choose files"
self isPartsBin.
self openInHand

Subclass TrashCanMorph

TrashCanMorph subclass: #BlakeTrashCanMorph
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: ' BlakeStuff'

acceptDroppingMorph: aMorph event:  evt
 ActiveWorld submorphs copy do: [:each | (each class  == BlakeMorph )
ifTrue: [each doSome]].


And you should implement what doSome is in your morph.

Hope this help

Use 3.10alpha http://ftp.squeak.org/3.10alpha/Squeak3.10alpha.7069.zip , so
I have first class feedback of problems and could help more if you need.

Or if you have a regular 3.9 final 7067, do a backup and try the load
updates button for convert your 3.9 to 3.10.
First update read the warning, you must save the image for what could load
3.10 specific stuff.
In the second step, answer no for do not deleting your porjects and in the
time of a coffe you have a 3.10 all green image :=)
Edgar






       

       
               
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Advice for design of simple program.

Blake-5
Edgar,

        Thanks for your advice. I'll ditch the toys.<s>

        ===Blake===

On Thu, 22 Mar 2007 02:01:39 -0800, Edgar J. De Cleene  
<[hidden email]> wrote:

> What I do if must cook your spec:
> Subclass ImageMorph
>
> ImageMorph subclass: #BlakeMorph
> instanceVariableNames: 'label number '
> classVariableNames: ''
> poolDictionaries: ''
> category: 'BlakeStuff'
>
> initialize
> super initialize.
> self image: Form fromFileNamed: "your path here or could use  
> FillInTheBlank
> for choose files"
> self isPartsBin.
> self openInHand
>
> Subclass TrashCanMorph
>
> TrashCanMorph subclass: #BlakeTrashCanMorph
>     instanceVariableNames: ''
>     classVariableNames: ''
>     poolDictionaries: ''
>     category: ' BlakeStuff'
>
> acceptDroppingMorph: aMorph event:  evt
>  ActiveWorld submorphs copy do: [:each | (each class  == BlakeMorph )
> ifTrue: [each doSome]].
>
>
> And you should implement what doSome is in your morph.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners