Morphic Layout

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

Morphic Layout

Gauland, Michael

Can anyone help me learn the ‘modern’ way of laying out morphs? I’m trying to create a stack-based (‘RPN’) calculate in Squeak (more as a way of learning the language and environment than because the world needs another calculator). I’ve been digging through ‘Squeak: Open Personal Computing and Multimedia”, which is a bit dated. The section on Morphic recommends using ‘AlignmentMorph’, but the comments for this class (in Squeak 3.10) suggest it is no longer needed.

 

So, what is the best way to layout a set of morphs? At least for now, all I need is a grid of buttons, that will look sensible when the parent calculator morph is resized.

 

Thanks in advance,

Mike

 

**********************************************************************

This electronic message together with any attachments is confidential. If

you receive it in error: (i) you must not use, disclose, copy or retain

it; (ii) please contact the sender immediately by reply email and then

delete the emails. Views expressed in this email may not be those of the

Airways Corporation of New Zealand Limited

**********************************************************************

 


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

Re: Morphic Layout

Michael van der Gulik-2


On Thu, Oct 30, 2008 at 9:32 AM, Gauland, Michael <[hidden email]> wrote:

Can anyone help me learn the 'modern' way of laying out morphs? I'm trying to create a stack-based ('RPN') calculate in Squeak (more as a way of learning the language and environment than because the world needs another calculator). I've been digging through 'Squeak: Open Personal Computing and Multimedia", which is a bit dated. The section on Morphic recommends using 'AlignmentMorph', but the comments for this class (in Squeak 3.10) suggest it is no longer needed.

 

So, what is the best way to layout a set of morphs? At least for now, all I need is a grid of buttons, that will look sensible when the parent calculator morph is resized.


Just use AlignmentMorph.

I don't understand any of the comments about it being deprecated. AlignmentMorph is still used throughout the image and works well enough.

Gulik.

--
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/

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

Re: Morphic Layout

Herbert König
In reply to this post by Gauland, Michael
Hello Michael,


GM> Can anyone help me learn the ‘modern’ way oflaying out
GM> morphs? I’m trying to create a stack-based (‘RPN’)calculate in
GM> So, what is the best way to layout a set of morphs? At
GM> leastfor now, all I need is a grid of buttons, that will look
GM> sensible when theparent calculator morph is resized.

TableLayout is your friend here. The class comment gives some hints. A
week or so ago there was a discussion about Morphic table layouts,
there you can find hints where to get grid layouts.

In general you can send a Morph
layoutPolicy: TableLayout new

I suggest you create a Morph, add a TableLayout like above, bring up
the halo, the red button offers layout.

There you can experiment and see the options you have.

If you don't look into the thread in Squeak dev, beware TableLayout
is no real table layout but a row or column layout.


--
Cheers,

Herbert  

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

Re: Morphic Layout

Edgar J. De Cleene
In reply to this post by Gauland, Michael



El 10/29/08 5:32 PM, "Gauland, Michael" <[hidden email]>
escribió:

> Can anyone help me learn the Œmodern¹ way of laying out morphs? I¹m trying to
> create a stack-based (ŒRPN¹) calculate in Squeak (more as a way of learning
> the language and environment than because the world needs another calculator).
> I¹ve been digging through ŒSqueak: Open Personal Computing and Multimedia²,
> which is a bit dated. The section on Morphic recommends using
> ŒAlignmentMorph¹, but the comments for this class (in Squeak 3.10) suggest it
> is no longer needed.
>  
> So, what is the best way to layout a set of morphs? At least for now, all I
> need is a grid of buttons, that will look sensible when the parent calculator
> morph is resized.
>  
> Thanks in advance,
> Mike


Building a Calculator was done as tutorial.....

Check http://wiki.squeak.org/squeak/5791

Sorry I don't have time to complete the "bad english" version, bud some
pictures in original work sure was enough for smart newbies.

And AligmentMorph is long, long , long time obsolete and no project using it
should born in XXI century.

Edgar


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

RE: Morphic Layout

Gauland, Michael
In reply to this post by Gauland, Michael
I've done some poking around with TableLayout, and I'm starting to get a feel for how it works. One that I haven't puzzled out is how to make a morph (I'm using a TextMorph inside a BorderedMorph) expand and contract as its containing morph (in my case, another BorderedMorph) is resized.  Any advice on this would be appreciated.

Thanks,
Mike


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Herbert König
Sent: Thursday, 30 October 2008 9:51 a.m.
To: A friendly place to get answers to even the most basic questions aboutSqueak.
Subject: Re: [Newbies] Morphic Layout

Hello Michael,


GM> Can anyone help me learn the 'modern' way oflaying out
GM> morphs? I'm trying to create a stack-based ('RPN')calculate in
GM> So, what is the best way to layout a set of morphs? At
GM> leastfor now, all I need is a grid of buttons, that will look
GM> sensible when theparent calculator morph is resized.

TableLayout is your friend here. The class comment gives some hints. A
week or so ago there was a discussion about Morphic table layouts,
there you can find hints where to get grid layouts.

In general you can send a Morph
layoutPolicy: TableLayout new

I suggest you create a Morph, add a TableLayout like above, bring up
the halo, the red button offers layout.

There you can experiment and see the options you have.

If you don't look into the thread in Squeak dev, beware TableLayout
is no real table layout but a row or column layout.


--
Cheers,

Herbert  

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

**********************************************************************
This electronic message together with any attachments is confidential. If
you receive it in error: (i) you must not use, disclose, copy or retain
it; (ii) please contact the sender immediately by reply email and then
delete the emails. Views expressed in this email may not be those of the
Airways Corporation of New Zealand Limited
**********************************************************************

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

Re[2]: Morphic Layout

Herbert König
Hello Michael,

GM> I've done some poking around with TableLayout, and I'm
GM> starting to get a feel for how it works. One that I haven't
GM> puzzled out is how to make a morph (I'm using a TextMorph inside a
GM> BorderedMorph) expand and contract as its containing morph (in my
GM> case, another BorderedMorph) is resized.  Any advice on this would
GM> be appreciated.

the inner Morph must have its childLayout horizontalResizing set to
#spaceFill. same with verticalResizing.

I never know this when I need it, so I take a rectangle and an
EllipseMorph from the object catalog, put the ellipse inside the
rectangle (red halo, embed into) and then I play with both Morphs
layout options.

Don't forget to pin both Morphs Menus to the screen.


--
Cheers,

Herbert  

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

RE: Re[2]: Morphic Layout

Gauland, Michael
In reply to this post by Gauland, Michael
Thanks for the tip--that's really a good way to get a feel for how things behave.

For anyone else interested in this thread, I'll also pass on a couple of pages I found helpful:

http://www.visoracle.com/squeak/faq/morphic-layout.html
http://coweb.cc.gatech.edu/cs2340/3659

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Herbert König
Sent: Tuesday, 4 November 2008 8:07 p.m.
To: A friendly place to get answers to even the most basic questions aboutSqueak.
Subject: Re[2]: [Newbies] Morphic Layout

Hello Michael,

GM> I've done some poking around with TableLayout, and I'm
GM> starting to get a feel for how it works. One that I haven't
GM> puzzled out is how to make a morph (I'm using a TextMorph inside a
GM> BorderedMorph) expand and contract as its containing morph (in my
GM> case, another BorderedMorph) is resized.  Any advice on this would
GM> be appreciated.

the inner Morph must have its childLayout horizontalResizing set to
#spaceFill. same with verticalResizing.

I never know this when I need it, so I take a rectangle and an
EllipseMorph from the object catalog, put the ellipse inside the
rectangle (red halo, embed into) and then I play with both Morphs
layout options.

Don't forget to pin both Morphs Menus to the screen.


--
Cheers,

Herbert  

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

**********************************************************************
This electronic message together with any attachments is confidential. If
you receive it in error: (i) you must not use, disclose, copy or retain
it; (ii) please contact the sender immediately by reply email and then
delete the emails. Views expressed in this email may not be those of the
Airways Corporation of New Zealand Limited
**********************************************************************

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