Morph Window -> Class? (was: error loading .pr file)

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

Morph Window -> Class? (was: error loading .pr file)

dabrowsa@indiana.edu
Thanks for your reply to my last message.  Now I have a follow-up
question.

If I want to save my project as a .cs file, then I will have to convert
my gui window (just a systemWindow with some buttons and textMorphs)
into a proper class that shows up in the browser, correct?  That is, my
window was not coded, but put together interactively by dragging
supplies out and using the viewer to attach scripts.  Is there a way to
convert the final product into a code format that can be exported in the
.cs file?

In VisualWorks (which I am also looking at but have not worked with at
all) there seems to be a way to do this: the InstallOnClass utility.  Is
there something comparable in Squeak?


>
> El 3/31/07 10:01 PM, "Andrew Dabrowski" <[hidden email]> escribió:
>
>> (RenamedClassSourceReader is Undeclared).
> RenamedClassSourceReader  don't exist in 3.9 final, that't why you have
> problems.
>
>> Is this a problem with 3.9?
> Maybe more as one, so we start 3.10 and you could try at
> http://ftp.squeak.org/3.10alpha/Squeak3.10alpha.7073.zip
>
> And if some was wrong, you could complain direct to me.
> As several things is changing, if you first Squeak experience , better learn
> with it.
>
> As sharing code, I like to send me via private mail your .pr and only you
> .cs.
>
> In general , .pr files works fine, but not always.
>
> And old release .pr could not work on newer images.
>
> Exist another ways of sharing code, I prefer using .sar what let's pack all
> needed files in one auto loading file.
> As example , in my Rompecabezas (puzzle) http://wiki.squeak.org/squeak/5861
> I have versions what let's guess image and load the necessary , if some is
> not in the target one.
>
>>From install/preamble of version what could load into normal 3.9 and
> SqueakLight
>
> | misFotos listaArchivos member form str |
> Smalltalk version  = 'SqueakLight' ifTrue:[ self fileInMemberNamed:
> 'MixedCurves.2.cs'.
>     self fileInMemberNamed: 'MinimalSound.2.cs'].
>
> self fileInMemberNamed: 'Morphic-Puzzle.47.cs'.
>
> member _ self memberNamed: 'CatClubBallooning.jpg'.
> PuzzleMorph foto: (Form fromBinaryStream: member contentStream binary).
> member _ self memberNamed: 'Taunt011.wav'.
> PuzzleMorph sonido: (member contentStream binary).
> PuzzleMorph allPieces
>
> And you have code, picts, sound, any what was necessary. Guessing version is
> a bonus track :=)
>
>
> Edgar
>

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

dabrowsa.vcf (162 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Morph Window -> Class? (was: error loading .pr file)

Edgar J. De Cleene



El 4/1/07 3:16 PM, "Andrew Dabrowski" <[hidden email]> escribió:

> Thanks for your reply to my last message.  Now I have a follow-up
> question.
>
> If I want to save my project as a .cs file, then I will have to convert
> my gui window (just a systemWindow with some buttons and textMorphs)
> into a proper class that shows up in the browser, correct?  That is, my
> window was not coded, but put together interactively by dragging
> supplies out and using the viewer to attach scripts.  Is there a way to
> convert the final product into a code format that can be exported in the
> .cs file?
>
> In VisualWorks (which I am also looking at but have not worked with at
> all) there seems to be a way to do this: the InstallOnClass utility.  Is
> there something comparable in Squeak?
Exist a kind of Morph to code, what sometimes lets you export code only.

Drag and drop the attached morph into your Squeak.

Open a Transcript whit World menu or via flaps.

Via halo, open a Inspector of the morph.
In lower pane type :
Transcript show: self constructorString  "for seeing what is the code of the
morph."

You should give:
(((AlignmentMorph newBounds: (0@822 corner: 597@848) color: Color
transparent) setBorderWidth: 1 borderColor: Color black)
    addAllMorphs: ((Array new: 7)
    at: 1 put: (((SimpleButtonMorph newBounds: (2@824 corner: 76@846) color:
Color green) setBorderWidth: 1 borderColor: (Color r: 0.36 g: 0.719 b:
0.541))
        addAllMorphs: (Array
        with: ((StringMorph newBounds: (6@828 corner: 73@843) color: Color
black) contents: 'workspace')));
    at: 2 put: (((SimpleButtonMorph newBounds: (76@824 corner: 146@846)
color: Color yellow) setBorderWidth: 1 borderColor: (Color r: 0.36 g: 0.719
b: 0.541))
        addAllMorphs: (Array
        with: ((StringMorph newBounds: (80@828 corner: 143@843) color: Color
black) contents: 'transcript')));
    at: 3 put: (((SimpleButtonMorph newBounds: (146@824 corner: 205@846)
color: Color orange) setBorderWidth: 1 borderColor: (Color r: 0.36 g: 0.719
b: 0.541))
        addAllMorphs: (Array
        with: ((StringMorph newBounds: (149@828 corner: 201@843) color:
Color black) contents: 'browser')));
    at: 4 put: (((SimpleButtonMorph newBounds: (205@824 corner: 332@846)
color: Color red) setBorderWidth: 1 borderColor: (Color r: 0.36 g: 0.719 b:
0.541))
        addAllMorphs: (Array
        with: ((StringMorph newBounds: (208@828 corner: 328@843) color:
Color black) contents: 'dual change sorter')));
    at: 5 put: (((SimpleButtonMorph newBounds: (332@824 corner: 385@846)
color: (Color r: 0.645 g: 0.0 b: 0.968)) setBorderWidth: 1 borderColor:
(Color r: 0.36 g: 0.719 b: 0.541))
        addAllMorphs: (Array
        with: ((StringMorph newBounds: (335@828 corner: 381@843) color:
Color black) contents: 'file list')));
    at: 6 put: (((SimpleButtonMorph newBounds: (385@824 corner: 490@846)
color: (Color r: 0.323 g: 1.0 b: 0.613)) setBorderWidth: 1 borderColor:
(Color r: 0.36 g: 0.719 b: 0.541))
        addAllMorphs: (Array
        with: ((StringMorph newBounds: (388@828 corner: 486@843) color:
Color black) contents: 'message names')));
    at: 7 put: (((SimpleButtonMorph newBounds: (490@824 corner: 595@846)
color: (Color r: 0.323 g: 1.0 b: 0.613)) setBorderWidth: 1 borderColor:
(Color r: 0.36 g: 0.719 b: 0.541))
        addAllMorphs: (Array
        with: ((StringMorph newBounds: (493@828 corner: 591@843) color:
Color black) contents: 'archive viewer')));
    yourself))

Before you ask, the transcript button need be "reinitialized" when go to new
image.
For doing that, via halo select the button (you need two clicks, one for the
AlignmentMorph  and the second for the button, this way you could see Morphs
inside Morphs and act via Inspector)
In the code pane of Inspector type select target as you see in pict.
Type again Transcript and do alt s or command s (for aceppting the change).
Presto, now you have the button working .

I hope you know now what could export only a morph and not a complete .pr
....

Next question ? :=)

Cheers

Edgar




_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Comandos.morph (10K) Download Attachment
Picture 1.png (17K) Download Attachment