Posted by
Tudor Girba-2 on
Jan 01, 2012; 10:51pm
URL: https://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251570p4251791.html
Oh, right.
I only provided the code for rendering, but it does not work when you execute it :).
The problem is that The MAContainerMorph does some morph removing magic that does not work with the GeneralScrollPane. So, I am replacing it with a MASilentContainerMorph. It's hack-ish, but it works. I would actually be interested in a cleaner solution.
Also, I did not provide a good model for the description.
model := MooseModel root allModels first allClasses first "or your code".
description := FAMIXClass asMooseDescription asMagritteDescriptionWithAnnotations "or your code".
(description morphClass = MAContainerMorph)
ifTrue: [description morphClass: MASilentContainerMorph].
magritteMorph := (description asMorphOn: model) addButtons; morph.
scrollPane := GeneralScrollPane new.
scrollPane changeScrollerTableLayout.
scrollPane scrollTarget: magritteMorph.
scrollPane layoutFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 1)).
scrollPane openInWindow
Cheers,
Doru
On 1 Jan 2012, at 23:27, Sean P. DeNigris wrote:
>
> 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)
>
>
> --
> View this message in context:
http://forum.world.st/Customizing-Magritte-Morphic-Forms-tp4251570p4251729.html> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
>
[hidden email]
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev--
www.tudorgirba.com
"Be rather willing to give than demanding to get."
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev