[Newbies] Can't open MorphLayoutArticle

John-Reed Maffeo jrmaffeo at gmail.com
Fri Jul 26 04:59:49 UTC 2019


Nicola,

You are doing quit well.
Note: All of the behavior of #AlignmentMorph is still in the image most of
it has been promoted to #Morph.
Note2: I am still very much a newbie with #Morph, but trying to answer your
questions makes me think about what I know.

Now to your questions:
1] How can I make the buttons fill all the third row length ?
        I think you have to change the bounds of the morphs to increase the
width. I am not sure which methods to use. (You can resize any morph by
using the #Halo
2] How do I embed newlines in textT1 string, I see '\n' is not working.
       I did a search of the image for methods which contain the string
'newline' and saw some code which inspired this  'aaaa', String crlf,
'bbbb'. Wrapped text is another option. Both of these require the height of
the container morph to be increased. I have seen text boxes (#TestMorph ?)
dynamically expand, but I don't know how it works.
3] How could i make the image in row4 fill its whole row (maybe same as [1])
       I think that this is the same as 1 too.
4] How can I show the Squeak logo into image "i1" ? Just to have something
nicer to display into examples.
       Which Squeak logo do you want to use? The Squeak logo in the
#DockingBar is an Icon. Check the Squeak wiki
http://wiki.squeak.org/squeak/2170 for Squeak Icons - Branding, or search
for Squeak Smalltalk images. Once you have an image on your computer create
an #ImageMorph using the method #setNewImageFrom:

Hopes this helps

-jrm



On Thu, Jul 25, 2019 at 10:59 AM Nicola Mingotti <nmingotti at gmail.com>
wrote:

>
> Hi,
>
> I could put together this example [code below], but I am stuck again on
> little things that are not so easy to find googling the docs.
>
> 1] How can I make the buttons fill all the third row length ?
> 2] How do I embed newlines in textT1 string, I see '\n' is not working.
> 3] How could i make the image in row4 fill its whole row (maybe same as
> [1])
> 4] How can I show the Squeak logo into image "i1" ? Just to have something
> nicer to display into examples.
>
> ---------------------
> m := RectangleMorph new.
> m openInWindow.
>
> "Initial size of the window".
> (m owner) extent: 300 at 300.
> (m owner) setLabel: 'Layout test-1'.
>
> m layoutPolicy: TableLayout new.
> m listDirection: #topToBottom.
> m hResizing: #spaceFill.
> m vResizing: #spaceFill.
> m color: Color yellow.
>
> row0 := AlignmentMorph newRow color: (Color white);
>                 hResizing: #spaceFill; vResizing: #spaceFill.
>
> row1 := AlignmentMorph newRow color: (Color r:100 g:100 b: 100);
>                 hResizing: #spaceFill; vResizing: #spaceFill.
>
> row2 := AlignmentMorph newRow color: (Color r:300 g:300 b: 300); height:
> 50;
>                 hResizing: #spaceFill; vResizing: #fixed.
>
> row3 := AlignmentMorph newRow color: (Color r:500 g:500 b: 500);
>                 hResizing: #spaceFill; vResizing: #spaceFill.
>
>
> m addMorphBack: row0.
> m addMorphBack: row1.
> m addMorphBack: row2.
> m addMorphBack: row3.
>
> t1 := TextMorph new.
> t1 wrapFlag: true.
> textT1 := '-] Autoresize buttons to fills space ? \n'.
> textT1 := textT1, '-] line 2. '.
> t1 contents: textT1.
> row0 addMorph: t1.
>
> 10 timesRepeat: [row1 addMorph: (CircleMorph new extent: 10 at 10; color:
> Color blue)].
>
> b1 := SimpleButtonMorph new.
> b1 borderWidth: 3 ; label: 'Button1'.
>
> b2 := SimpleButtonMorph new.
> b2 borderWidth: 3 ; label: 'Button2'.
>
> row2 addMorph: b1.
> row2 addMorph: b2.
>
> i1 := ImageMorph new.
> row3 addMorph: i1.
> ---------------------
>
> bye
> Nicola
>
>
>
>
> On Jul 25, 2019, at 5:11 PM, John-Reed Maffeo <jrmaffeo at gmail.com> wrote:
>
> Hello Nicola,
>
> Check out https://wiki.squeak.org/squeak/52 - How to lay out submorphs -
> example 1
>
> There are several other layout links similar to this one.
>
> Note: AlignmentMorph has been deprecated, but it is still present in
> methods in current Squeak images.
>
> -jrm
>
> On Thu, Jul 25, 2019 at 1:14 AM Nicola Mingotti <nmingotti at gmail.com>
> wrote:
>
>> Hi,
>>
>> I am trying to understand the layout in Morph. I am familiar with other
>> GUI toolkit as Tk, so It should not be a problem, I need just to see some
>> simple examples.
>>
>> It is quite difficult to find information about this subject.
>>
>> I finally landed here:
>> https://wiki.squeak.org/squeak/2400
>>
>> Bue when I try to open the file "MorphLayoutArticle.pr" in Squeak 5.2 I
>> get a lot of errors.
>>
>> Is there around a working version of MorphLayoutArticle ?
>>
>> bye
>> Nicola
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190725/8c47ed38/attachment-0001.html>


More information about the Beginners mailing list