Customizing Magritte Morphic Forms

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

Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
I'm playing with and already enjoying Magritte after the awesome talk Nick and Esteban gave at ESUG this year.

How do I customize Magritte editors in Morphic? Specifically, for the Address example from the Seaside book, I tried:
        anAddress asMorph
                addButtons;
                addWindow;
                openInWorld.

but the fields were really tiny and hid most of the text as you can see below (on Nabble at least):


Then I tried a standard Morphic approach:
        | form window |
        form := anAddress asMorph addButtons.
        window := SystemWindow new addMorph: form fullFrame: (LayoutFrame fractions: (0@0 corner: 1.0@1.0) offsets: (10@10 corner: 10@10)).
        window openInWorld.

but I got "MessageNotUnderstood: MAContainerMorph>>layoutFrame:"
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Lukas Renggli
You might want to ask this question in the Moose or Pharo list: the
Glamour people are probably the only users of Magritte-Morphic right
now. I haven't tried it in any recent Pharo image.

Lukas

On 1 January 2012 21:40, Sean P. DeNigris <[hidden email]> wrote:

> I'm playing with and already enjoying Magritte after the awesome talk Nick
> and Esteban gave at ESUG this year.
>
> How do I customize Magritte editors in Morphic? Specifically, for the
> Address example from the Seaside book, I tried:
>        anAddress asMorph
>                addButtons;
>                addWindow;
>                openInWorld.
>
> but the fields were really tiny and hid most of the text as you can see
> below (on Nabble at least):
> http://forum.world.st/file/n4251518/PharoScreenshot.2.png
>
> Then I tried a standard Morphic approach:
>        | form window |
>        form := anAddress asMorph addButtons.
>        window := SystemWindow new addMorph: form fullFrame: (LayoutFrame
> fractions: (0@0 corner: 1.0@1.0) offsets: (10@10 corner: 10@10)).
>        window openInWorld.
>
> but I got "MessageNotUnderstood: MAContainerMorph>>layoutFrame:"
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251518.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
Lukas Renggli wrote
You might want to ask this question in the Moose or Pharo list
Okay, thanks Lukas, I will.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

EstebanLM
In reply to this post by Sean P. DeNigris
Hi Sean,

I fixed that... if you update Magritte-Morphic package it should be there...

Cheers,
Esteban

El 01/01/2012, a las 5:40p.m., Sean P. DeNigris escribió:

> I'm playing with and already enjoying Magritte after the awesome talk Nick
> and Esteban gave at ESUG this year.
>
> How do I customize Magritte editors in Morphic? Specifically, for the
> Address example from the Seaside book, I tried:
> anAddress asMorph
> addButtons;
> addWindow;
> openInWorld.
>
> but the fields were really tiny and hid most of the text as you can see
> below (on Nabble at least):
> http://forum.world.st/file/n4251518/PharoScreenshot.2.png 
>
> Then I tried a standard Morphic approach:
> | form window |
> form := anAddress asMorph addButtons.
> window := SystemWindow new addMorph: form fullFrame: (LayoutFrame
> fractions: (0@0 corner: 1.0@1.0) offsets: (10@10 corner: 10@10)).
> window openInWorld.
>
> but I got "MessageNotUnderstood: MAContainerMorph>>layoutFrame:"
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251518.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Tudor Girba-2
In reply to this post by Sean P. DeNigris
Hi,

Here is the code from the rendering in Glamour:

magritteMorph := FAMIXClass asMooseDescription asMagritteDescription
                        asMorph
                                addButtons;
                                morph.
scrollPane := GeneralScrollPane new.
scrollPane changeScrollerTableLayout.
scrollPane scrollTarget: magritteMorph.
scrollPane layoutFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 1)).
scrollPane openInWindow

I use the GeneralScrollPane because it lets you fill on one dimension and have a scroll on the other dimension.

Cheers,
Doru


On 1 Jan 2012, at 21:40, Sean P. DeNigris wrote:

> I'm playing with and already enjoying Magritte after the awesome talk Nick
> and Esteban gave at ESUG this year.
>
> How do I customize Magritte editors in Morphic? Specifically, for the
> Address example from the Seaside book, I tried:
> anAddress asMorph
> addButtons;
> addWindow;
> openInWorld.
>
> but the fields were really tiny and hid most of the text as you can see
> below (on Nabble at least):
> http://forum.world.st/file/n4251518/PharoScreenshot.2.png 
>
> Then I tried a standard Morphic approach:
> | form window |
> form := anAddress asMorph addButtons.
> window := SystemWindow new addMorph: form fullFrame: (LayoutFrame
> fractions: (0@0 corner: 1.0@1.0) offsets: (10@10 corner: 10@10)).
> window openInWorld.
>
> but I got "MessageNotUnderstood: MAContainerMorph>>layoutFrame:"
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251518.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

--
www.tudorgirba.com

"What we can governs what we wish."




_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
In reply to this post by EstebanLM
EstebanLM wrote
I fixed that... if you update Magritte-Morphic package it should be there...
Thanks Esteban. I have loaded Magritte-Morph-jmck.49, which seems to be the latest version at http://source.lukas-renggli.ch/magritte
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
In reply to this post by Tudor Girba-2
Tudor Girba-2 wrote
Here is the code from the rendering in Glamour:
Thanks for the immediate feedback!

I realized from your snippet what was missing in my attempt:

| form window |
        form := anAddress asMorph addButtons.
        window := SystemWindow new addMorph: form ***morph*** fullFrame: (LayoutFrame fractions: (0@0 corner: 1.0@1.0) offsets: (10@10 corner: 10@10)).
        window openInWorld.

OMG! It seems terribly misleading to me to call something a morph that is not a morph. This violates the principle of least surprise, and while surprises are nice today because it's a holiday, not so much the rest of the year ;-)

Humble suggestions:
1) change #asMorph to something like forMorphic
2) make #addWindow behave more reasonably
3) MAContainerMorph and friends -> MAMorphicContainer
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

EstebanLM
In reply to this post by Sean P. DeNigris
you need to go magritte2 repository...

El 01/01/2012, a las 6:16p.m., Sean P. DeNigris escribió:

>
> EstebanLM wrote
>>
>> I fixed that... if you update Magritte-Morphic package it should be
>> there...
>>
>
> Thanks Esteban. I have loaded Magritte-Morph-jmck.49, which seems to be the
> latest version at http://source.lukas-renggli.ch/magritte
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251595.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
EstebanLM wrote
you need to go magritte2 repository...
Has that superseded the other? http://www.lukas-renggli.ch/smalltalk/magritte still points to v. 1
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

EstebanLM
yep... it is much more update :)

El 01/01/2012, a las 6:41p.m., Sean P. DeNigris escribió:

>
> EstebanLM wrote
>>
>> you need to go magritte2 repository...
>>
>
> Has that superseded the other?
> http://www.lukas-renggli.ch/smalltalk/magritte still points to v. 1
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251647.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Tudor Girba-2
In reply to this post by Sean P. DeNigris
Yes, if you start now, you should work with Magritte2.

Doru


On 1 Jan 2012, at 22:41, Sean P. DeNigris wrote:

>
> EstebanLM wrote
>>
>> you need to go magritte2 repository...
>>
>
> Has that superseded the other?
> http://www.lukas-renggli.ch/smalltalk/magritte still points to v. 1
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251647.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

--
www.tudorgirba.com

"There are no old things, there are only old ways of looking at them."




_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Lukas Renggli
In reply to this post by Sean P. DeNigris
Thank you, I've updated the links.

The difference between Magritte 1 and 2 is minimal. The new version
was merely a way to align Magritte with Pier 2.

Lukas

On 1 January 2012 22:41, Sean P. DeNigris <[hidden email]> wrote:

>
> EstebanLM wrote
>>
>> you need to go magritte2 repository...
>>
>
> Has that superseded the other?
> http://www.lukas-renggli.ch/smalltalk/magritte still points to v. 1
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251647.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
In reply to this post by Tudor Girba-2
Tudor Girba-2 wrote
Here is the code from the rendering in Glamour:
Tudor Girba-2 wrote
Here is the code from the rendering in Glamour:
With this approach:
morph := anAddress asMorph
                addButtons;
                morph.
               
        scrollPane := GeneralScrollPane new.
        scrollPane changeScrollerTableLayout.
        scrollPane scrollTarget: morph.
        scrollPane layoutFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 1)).
        scrollPane openInWindow

I got an emergency evaluator when I clicked "Save":

THERE_BE_DRAGONS_HERE
SubscriptOutOfBounds: 1
1 January 2012 5:24:26 pm

VM: Mac OS - intel - 1072 - Croquet Closure Cog VM [CoInterpreter VMMaker-oscog-EstebanLorenzano.139] 21.0
Image: Pharo1.3 [Latest update: #13320]

Array(Object)>>errorSubscriptBounds:
        Receiver: #()
        Arguments and temporary variables:
                index: 1
        Receiver's instance variables:
#()

Array(Object)>>at:
        Receiver: #()
        Arguments and temporary variables:
                index: 1
        Receiver's instance variables:
#()

Array(SequenceableCollection)>>first
        Receiver: #()
        Arguments and temporary variables:

        Receiver's instance variables:
#()

GeneralScrollPane>>scrollTarget
        Receiver: a GeneralScrollPane(440139776)
        Arguments and temporary variables:

        Receiver's instance variables:
                bounds: 50@139 corner: 686@431
                owner: a SystemWindow(908591104)
                submorphs: an Array(a TransformWithLayoutMorph(445382656))
                fullBounds: 50@139 corner: 686@431
                color: Color transparent
                extension: a MorphExtension (222822400) [other:  (myDependents -> a DependentsA...etc...
                scroller: a TransformWithLayoutMorph(445382656)
                hScrollbar: a GeneralScrollBar(471334912)
                vScrollbar: a GeneralScrollBar(237240320)
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
In reply to this post by EstebanLM
EstebanLM wrote
I fixed that... if you update Magritte-Morphic package it should be there...
Okay, I'm all sorted out now. The magic incantation was:
1) Gofer new
                squeaksource: 'MetacelloRepository';
                package: 'ConfigurationOfMagritte2';
                load.
        (Smalltalk at: #ConfigurationOfMagritte2) perform: #load.
2) Load Magritte-Morph-EstebanLorenzano.57
3) anAddress asMorph
                addButtons;
                addWindow;
                openInWorld.


As implied above, the config doesn't include the fix. Should it be updated?
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

EstebanLM
oh, crap... sorry... I'll add this to the list of little things that emerged this couple of days and will fix all of them tomorrow...

cheers,
Esteban


El 01/01/2012, a las 7:46p.m., Sean P. DeNigris escribió:

>
> EstebanLM wrote
>>
>> I fixed that... if you update Magritte-Morphic package it should be
>> there...
>>
>
> Okay, I'm all sorted out now. The magic incantation was:
> 1) Gofer new
> squeaksource: 'MetacelloRepository';
> package: 'ConfigurationOfMagritte2';
> load.
> (Smalltalk at: #ConfigurationOfMagritte2) perform: #load.
> 2) Load Magritte-Morph-EstebanLorenzano.57
> 3) anAddress asMorph
> addButtons;
> addWindow;
> openInWorld.
>
>
> As implied above, the config doesn't include the fix. Should it be updated?
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251772.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

EstebanLM
In reply to this post by Sean P. DeNigris
Hi Sean,

maybe there is something wrong with your installed packages, because I tried exactly same steps as you defined (well... I tried "MAStringDescription new" instead "anAdress"), and it is working for me.

best,
Esteban

El 01/01/2012, a las 7:46p.m., Sean P. DeNigris escribió:

>
> EstebanLM wrote
>>
>> I fixed that... if you update Magritte-Morphic package it should be
>> there...
>>
>
> Okay, I'm all sorted out now. The magic incantation was:
> 1) Gofer new
> squeaksource: 'MetacelloRepository';
> package: 'ConfigurationOfMagritte2';
> load.
> (Smalltalk at: #ConfigurationOfMagritte2) perform: #load.
> 2) Load Magritte-Morph-EstebanLorenzano.57
> 3) anAddress asMorph
> addButtons;
> addWindow;
> openInWorld.
>
>
> As implied above, the config doesn't include the fix. Should it be updated?
>
> --
> View this message in context: http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251518p4251772.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Magritte Morphic Forms

Sean P. DeNigris
Administrator
EstebanLM wrote
maybe there is something wrong with your installed packages, because I tried exactly same steps as you defined (well... I tried "MAStringDescription new" instead "anAdress"), and it is working for me.
Thanks for looking into this Esteban. When I load via the config into a fresh Pharo 1.3 image, I get the fields-too-small-for-the-content behavior. If I manually load Load Magritte-Morph-EstebanLorenzano.57, the fields are stretched to the width of the window, like shown in the docs (http://scg.unibe.ch/archive/masters/Reng06a.pdf pg. 9). So I think the config just needs to be updated.

btw here's the MsAddress fileout if that helps MagritteSpd-Example.st
Cheers,
Sean