On Thu, 2015-04-02 at 16:33 -0400, Dan Norton wrote:
> >On 4/1/2015 1:00 PM, Dan Norton wrote: > >> On 31 Mar 2015 at 10:30, Juan Vuletich wrote: > >> > [snip] > >> > >>> Have you read the class comments at LayoutSpec and LayoutMorph? In > >>> addition, LayoutMorph > >>> has an 'examples' class category. Try each one. Resize the top > >>> morph, and see layouts in action. > >>> inspect / explore the morphs, etc. Try to figure out what's > >>> happening... > >> Having resized the top morph, what's the best way to determine which > >> layout is which? > >> > > > >Use middle click on the top morph to open a halo on it. From there, open > >an explorer. You can see the morph tree and play with it. > > > >BTW, be sure to try making it rather large, so you can see all the > >morphs inside. For example, #example11 has three rows, the first one > >with 5 boxes and 4 draggeable separators, etc. You can open a halo on > >each one to inspect it and so on... > > > (Trying to explain it better) let's say you are reading code and you see that > LayoutMorph has examples. You bring up example2, middle click and use the resize > halo to make it larger. (Suggestion: the example should make it large enough to > distinguish the morphs.) > > You see in the browser that row has 3 submorphs which are BorderedRectMorphs. > You middle click on one of the rectangular morphs on the screen to get the halos. At > the bottom you see "a BorderedRectMorph(1639)" IMHO this is perfectly correct but > utterly useless information because all the others will have similar info with different > numbers, none of which tie back to what you see in the browser. Further these > numbers will change upon the next instantiation. > > A simple solution is to have #name as an instance variable with 2 supporting > methods: #name: and #printOn: . When #name: 'foo' is OPTIONALLY sent, the > name will appear as "a BorderedRectMorph(1639)'foo'" when you middle click on > the morph. > Rather than adding an ivar, why not just use a Morph property? (i.e. #setProperty:toValue: and #valueOfProperty:) > _______________________________________________ > Cuis mailing list > [hidden email] > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
In reply to this post by Dan Norton
On Thu, 02 Apr 2015 13:50:29 -0400
"Dan Norton" <[hidden email]> wrote: > I tried installing on Cuis 4.2-2203 rather than 2198 per the ReadMe because that's what was > handy. This is on a PC running 'Doze 7. Trying to use the ReadMe to install was not > successful. However, from File List I did install the package. If the Cuis-Smalltalk-Morphic-Misc1 directory is a sibling of Cuis-Smalltalk-Dev, doIt on Feature require: #'Morphic-Misc1'. should have found the package. > Not sure what you mean by option-click but button3 and cmd-button3 do the same thing: > bring up the halos. I am using Linux. The option keys differ. > The menu has your items at the end. Good. > Tried edit Layout on LayoutMorph example2. Changed from row to column, clicked update > and the change took place but the editor quit. Right. The current design is a one-shot pop-up editor. Just a single cancel or update. I'll have to change the code to add a 'push-pin'. You are the first person to request this. > Could the way I installed cause this behavior? This has real potential and I'd like to see it > working better. Nope. One-shot by design. I'll try to get to it soon. Thanks for the feedback, -KenD _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
|
In reply to this post by Phil B
On 2 Apr 2015 at 16:53, Phil (list) wrote:
> On Thu, 2015-04-02 at 16:33 -0400, Dan Norton wrote: [snip] > > A simple solution is to have #name as an instance variable with 2 > supporting > > methods: #name: and #printOn: . When #name: 'foo' is OPTIONALLY > sent, the > > name will appear as "a BorderedRectMorph(1639)'foo'" when you > middle click on > > the morph. > > > > Rather than adding an ivar, why not just use a Morph property? > (i.e. > #setProperty:toValue: and #valueOfProperty:) > Morph>>printOn: could do the job with one line added: printOn: aStream super printOn: aStream. aStream nextPutAll: '('. aStream print: self identityHash; nextPutAll: ')'. self valueOfProperty: #morphName ifPresentDo: [:x | aStream nextPutAll: x asString] _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
On 4/2/2015 9:24 PM, Dan Norton wrote:
> On 2 Apr 2015 at 16:53, Phil (list) wrote: > >> On Thu, 2015-04-02 at 16:33 -0400, Dan Norton wrote: > [snip] >>> A simple solution is to have #name as an instance variable with 2 >> supporting >>> methods: #name: and #printOn: . When #name: 'foo' is OPTIONALLY >> sent, the >>> name will appear as "a BorderedRectMorph(1639)'foo'" when you >> middle click on >>> the morph. >>> >> Rather than adding an ivar, why not just use a Morph property? >> (i.e. >> #setProperty:toValue: and #valueOfProperty:) >> > +1 > > Morph>>printOn: could do the job with one line added: > > printOn: aStream > > super printOn: aStream. > aStream nextPutAll: '('. > aStream > print: self identityHash; > nextPutAll: ')'. > self valueOfProperty: #morphName ifPresentDo: [:x | aStream nextPutAll: x asString] > Yes, that's a good idea. Cheers, Juan Vuletich _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
In reply to this post by Juan Vuletich-4
Just jumping in here late Juan, but...
In a Smalltalk environment, continuations may be somewhat expensive because the way we pull it off is keeping our closures on the heap. Don't quote me on this, and I can't immediately cite any sources (sorry) but I recall reading that systems that can do tail-call elimination can cut down on the cost significantly. Folks, I'm just spitting back out something I've read and I can't back it up. I'd like to know if someone can tell me that I'm wrong about this and such. Cheers! --C > On Mar 30, 2015, at 6:11 AM, Juan Vuletich <[hidden email]> wrote: > >> On 3/28/2015 11:02 PM, Ken.Dickey wrote: >> On Sat, 28 Mar 2015 18:14:07 -0700 >> Casey Ransberger<[hidden email]> wrote: >> >>> So did you do the continuation passing thing entirely with block closures? >> Guilty as charged. >> >>> If so, I have to say I kind of like not having to add a class. But making the code easy to debug has some goodness to it as well. >> I don't think callcc/currentDo: will be esier to debug. I'm just starting to play with the trivial port of Continuation from SeaSide. >> >> I suspect it will take me some time to find a style which helps. Elegance takes much time, not that I have much. >> >>> Anyway, cool:) >> Glad you think so. >> >> Great to have real closures in Squeak/Cuis/Pharo after many years of context blocks. Closures are so much more usable! >> >> Basically CPS was just the easiest way to get the control flow explicit so that it could be disentangled from the animation. >> >> I am still trying for "the simplest thing that will work". >> >> It sometimes takes an amazing amount of work to find the right simplicity. > > Indeed. You must first understand all the superfluous stuff well enough to know what to remove and what to keep... > > Now that you have published Continuations for Cuis, I took a look at them... And found at http://www.jquigley.com/files/talks/continuations.pdf : > > "Even hard-core continuation fans don’t use them directly except as means to implement better-behaved abstractions." > > Besides, Continuations require reification of the execution context as a regular object (to be gc'ed later), instead of just a stack. I believe this means that using Continuations to implement control structures to be used for coding could have a significant performance penalty. > > I hope you'll eventually reach a style based on morphic stepping, that is simple enough to code and debug. > > Cheers, > Juan Vuletich > >> Cheers, >> -KenD > > > _______________________________________________ > Cuis mailing list > [hidden email] > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
On Sat, 4 Apr 2015 22:15:09 -0700
Casey Ransberger <[hidden email]> wrote: > Just jumping in here late Juan, but... > > In a Smalltalk environment, continuations may be somewhat expensive because the way we pull it off is keeping our closures on the heap. Continuations are expensive as currently implemented in Cuis. THey can be nade much cheaper, but it takes work to do so. They are also like GOTOs in that they are in general too powerful. One can think of making a copy of the stack when a continuation is captured. In most cases, you really only reuse a bit of stack at the end, hence interest in "delimited continuations", "one-shot continuations" and so forth. In the current context, it is much cheaper to use closures. It seems simpler to me as well. > Don't quote me on this, and I can't immediately cite any sources (sorry) but I recall reading that systems that can do tail-call elimination can cut down on the cost significantly. Tail call elimination is important to reduce stack usage. If the last thing one does in a method is 'call' another method, we say the call is in the 'tail' position. In such cases, you don't need to push another stack frame, you can adjust (if required) and reuse the current stack frame. Pushing a new stack frame is doing too much work and grows the stack unnecessarily. Where a different number of arguments are passed, one may have to adjust the stack frame size. If you do 'tail call elimination' you are eliminating the extra push of a stack frame and can express all control flow as message sends. One thinks of a tail call as a goto which pases arguments. With closures, one has to do 'escape analysis' to see what 'captured variables' are actually shared and allocate them on the heap rather than in the stack. This is because closures or continuations may be invoked multiple times and any shares state must be 'seen' the same by all. -- -KenD _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
|
In reply to this post by Casey Ransberger-2
Hi Folks,
On 4/5/2015 2:15 AM, Casey Ransberger wrote: > Just jumping in here late Juan, but... > > In a Smalltalk environment, continuations may be somewhat expensive because the way we pull it off is keeping our closures on the heap. > > Don't quote me on this, and I can't immediately cite any sources (sorry) but I recall reading that systems that can do tail-call elimination can cut down on the cost significantly. > > Folks, I'm just spitting back out something I've read and I can't back it up. I'd like to know if someone can tell me that I'm wrong about this and such. A bit of googling brought http://c2.com/cgi/wiki?ContinuationImplementation and http://www.cs.indiana.edu/~dyb/pubs/stack.pdf . The Segmented Stack idea is very clever, and solves the problem in a nice way. It would be great to have it in our VMs. Not a minor job, though. Cheers, Juan Vuletich > Cheers! > > --C > _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
In reply to this post by Dan Norton
On Thu, 02 Apr 2015 13:50:29 -0400
"Dan Norton" <[hidden email]> wrote: > Tried edit Layout on LayoutMorph example2. Changed from row to column, clicked update > and the change took place but the editor quit. Dan, I cleaned up appearances, added a "push pin" in the upper-right, and added a "Show Halo" button to denote which morph is having its layout info edited. Probably bugs. Also, I need to change the title area to be a proper layout rather than hard coding buttom locations. But should be more helpful than old Layout and LayoutSpec editors. Bugs & suggestions to me, -KenD _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
|
In reply to this post by Juan Vuletich-4
Hi Juan et al,
I’ve been pondering on how to position and size morphs (based on Juan's comment below about automatic layout in an earlier exchange) without having an intermediate layer of layoutMorphs. Attached is a fileout of a test class with a class method “example 1” showing a rectangle that varies its size based on its owner (I’m also writing the method to reset the location of a morph if it wishes to be remain in the same location relative to the midpoints of two sides of the enclosing morph.) This way a morph can be positioned and at any time sent a message to relocate or resize itself based on its then owner. That way there are only two actors, the morph and its owner, and a morph knows (based on two messages, whether it should maintain its relative place and size within its owner. Although I have got a bit of the hang of layoutMorphs, I’m exploring whether positioning and repositioning a lot of elements in my UI may be easier with this approach. I was wondering what you think of this approach. Regards, Hari
_______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org ProportionallyResizingRect.st (5K) Download Attachment |
On Tue, 12 May 2015 00:24:06 -0400
Hari Balaraman <[hidden email]> wrote: > Hi Juan et al, > > I’ve been pondering on how to position and size morphs (based on Juan's comment below about automatic layout in an earlier exchange) without having an intermediate layer of layoutMorphs. > > Attached is a fileout of a test class with a class method “example 1” showing a rectangle that varies its size based on its owner (I’m also writing the method to reset the location of a morph if it wishes to be remain in the same location relative to the midpoints of two sides of the enclosing morph.) > > This way a morph can be positioned and at any time sent a message to relocate or resize itself based on its then owner. That way there are only two actors, the morph and its owner, and a morph knows (based on two messages, whether it should maintain its relative place and size within its owner. Although I have got a bit of the hang of layoutMorphs, I’m exploring whether positioning and repositioning a lot of elements in my UI may be easier with this approach. > > I was wondering what you think of this approach. Hari, I think we all need to get more experience building things to see what works and is as simple as we can make it. Please continue to build things and share them! Here is the example using aLayoutMorpk and a LayoutSpec. example2 " self example2. " | f g | g := LayoutMorph initializedInstance openInWorld. g padding: 0.5. "center" f := RectangleLikeMorph new. g morphExtent:400@400; color: Color orange. g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 proportionalHeight: 0.25). f morphPosition:150@150; color: Color blue. g morphPosition:70@70. Cheers, -KenD _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
|
Hi Ken,
Thanks for your reply. It came in just as I finished a slightly improved version of the code I presented earlier. This code moves the embedded morph in relation to the enclosing morph (by moving the centre of the embedded morph in proportion to the centre of the container morph.) I moved the variables and methods I used in the attached test class (including the stepAt method) upstream to RectangleLikeMorph to test and attach some screenshots (of that testing) when I embed an EllipseMorph into a BorderedRectMorph and switch ‘proportionalresize' off and on within the embedded morph while resizing the container morph. Thus, I maintain control over layout on a per embedded morph basis. A: B: proportionalresize on, container enlarged C: proportionalresize switched off, container made small D: proportionalresize on, container enlarged again. I don’t yet have a sense of what load the additional variables and methods put on the system when added at the top of the hierarchy (other than my laptop fan not going insane), but since the tax is on the individual embedded morph for maintaining layout, I hope it is small. Best regards, Hari > On May 12, 2015, at 5:52 PM, Ken.Dickey <[hidden email]> wrote: > > On Tue, 12 May 2015 00:24:06 -0400 > Hari Balaraman <[hidden email]> wrote: > >> Hi Juan et al, >> >> I’ve been pondering on how to position and size morphs (based on Juan's comment below about automatic layout in an earlier exchange) without having an intermediate layer of layoutMorphs. >> >> Attached is a fileout of a test class with a class method “example 1” showing a rectangle that varies its size based on its owner (I’m also writing the method to reset the location of a morph if it wishes to be remain in the same location relative to the midpoints of two sides of the enclosing morph.) >> >> This way a morph can be positioned and at any time sent a message to relocate or resize itself based on its then owner. That way there are only two actors, the morph and its owner, and a morph knows (based on two messages, whether it should maintain its relative place and size within its owner. Although I have got a bit of the hang of layoutMorphs, I’m exploring whether positioning and repositioning a lot of elements in my UI may be easier with this approach. >> >> I was wondering what you think of this approach. > > Hari, > > I think we all need to get more experience building things to see what works and is as simple as we can make it. > > Please continue to build things and share them! > > Here is the example using aLayoutMorpk and a LayoutSpec. > > example2 > " > self example2. > " | f g | > g := LayoutMorph initializedInstance openInWorld. > g padding: 0.5. "center" > f := RectangleLikeMorph new. > g morphExtent:400@400; color: Color orange. > g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 proportionalHeight: 0.25). > f morphPosition:150@150; color: Color blue. > g morphPosition:70@70. > > > Cheers, > -KenD _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org Screen Shot A.png (181K) Download Attachment Screen Shot B.png (126K) Download Attachment Screen Shot C.png (207K) Download Attachment Screen Shot D.png (124K) Download Attachment ProportionallyResizingRect.st (6K) Download Attachment |
Hi Hari,
I think it is great that you experiment. For sure you'll learn and have fun. And maybe you can contribute useful code. On 5/12/2015 7:19 PM, Hari Balaraman wrote: Hi Ken, Thanks for your reply. It came in just as I finished a slightly improved version of the code I presented earlier. This code moves the embedded morph in relation to the enclosing morph (by moving the centre of the embedded morph in proportion to the centre of the container morph.) I moved the variables and methods I used in the attached test class (including the stepAt method) upstream to RectangleLikeMorph to test and attach some screenshots (of that testing) when I embed an EllipseMorph into a BorderedRectMorph and switch ‘proportionalresize' off and on within the embedded morph while resizing the container morph. Thus, I maintain control over layout on a per embedded morph basis. ... I don’t yet have a sense of what load the additional variables and methods put on the system when added at the top of the hierarchy (other than my laptop fan not going insane), but since the tax is on the individual embedded morph for maintaining layout, I hope it is small. Best regards, Hari Well, the cost is not so much loading the system, but the extra stuff that everybody needs to keep in our heads. Besides, there are yet more possibilities, besides Layouts in Ken's example. For instance, in a workspace evaluate: g _ RectangleLikeMorph new openInWorld. f _ EllipseMorph new. g morphExtent: 400@400; color: Color orange. g addMorph: f. f morphPosition: 50@50; color: Color blue. g morphPosition:70@70. Then, in the same workspace, try: g rotation: 0.0 scale: 0.5. or: g rotation: 0.0 scale: 2. When Morphic3 is ready, this will also work: g rotation: 1.0 scale: 1.0. The idea is that each morph can define its own coordinate system. Cheers, Juan Vuletich On May 12, 2015, at 5:52 PM, Ken.Dickey [hidden email] wrote: On Tue, 12 May 2015 00:24:06 -0400 Hari Balaraman [hidden email] wrote:Hi Juan et al, I’ve been pondering on how to position and size morphs (based on Juan's comment below about automatic layout in an earlier exchange) without having an intermediate layer of layoutMorphs. Attached is a fileout of a test class with a class method “example 1” showing a rectangle that varies its size based on its owner (I’m also writing the method to reset the location of a morph if it wishes to be remain in the same location relative to the midpoints of two sides of the enclosing morph.) This way a morph can be positioned and at any time sent a message to relocate or resize itself based on its then owner. That way there are only two actors, the morph and its owner, and a morph knows (based on two messages, whether it should maintain its relative place and size within its owner. Although I have got a bit of the hang of layoutMorphs, I’m exploring whether positioning and repositioning a lot of elements in my UI may be easier with this approach. I was wondering what you think of this approach.Hari, I think we all need to get more experience building things to see what works and is as simple as we can make it. Please continue to build things and share them! Here is the example using aLayoutMorpk and a LayoutSpec. example2 " self example2. " | f g | g := LayoutMorph initializedInstance openInWorld. g padding: 0.5. "center" f := RectangleLikeMorph new. g morphExtent:400@400; color: Color orange. g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 proportionalHeight: 0.25). f morphPosition:150@150; color: Color blue. g morphPosition:70@70. Cheers, -KenD_______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
Hi Juan, Thank you for your reply. My replies to specific points are inline.
Hopefully soon! At this point, the only benefit to you is seeing how a newbie tackles the system.
That does sound interesting. I'd like to explore how morphs can be aware of and organise themselves around other morphs as peers (either when told about them or not.) As organic an approach as possible.
_______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
Hari,
A suggestion: Maybe you can write some learner's notes written from your perspective (questions and answers) we may add then to as a file to https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/tree/master/Documentation Tentative title Some suggestions for Cuis Morphic experiments for learners. BTW here a have a series of Layout experiments which were fine one year ago https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st I have not checked if they are still fine with the current Cuis. The layout experiments start very simple and one builds on the other. --Hannes On 5/13/15, Hari Balaraman <[hidden email]> wrote: > Hi Juan, > Thank you for your reply. > My replies to specific points are inline. > >> On May 13, 2015, at 9:53 AM, Juan Vuletich <[hidden email]> wrote: >> >> Hi Hari, >> >> I think it is great that you experiment. For sure you'll learn and have >> fun. And maybe you can contribute useful code. > > Hopefully soon! At this point, the only benefit to you is seeing how a > newbie tackles the system. > >>> On 5/12/2015 7:19 PM, Hari Balaraman wrote: >>> Hi Ken, >>> >>> Thanks for your reply. It came in just as I finished a slightly improved >>> version of the code I presented earlier. This code moves the embedded >>> morph in relation to the enclosing morph (by moving the centre of the >>> embedded morph in proportion to the centre of the container morph.) I >>> moved the variables and methods I used in the attached test class >>> (including the stepAt method) upstream to RectangleLikeMorph to test and >>> attach some screenshots (of that testing) when I embed an EllipseMorph >>> into a BorderedRectMorph and switch ‘proportionalresize' off and on >>> within the embedded morph while resizing the container morph. Thus, I >>> maintain control over layout on a per embedded morph basis. >>> ... >>> I don’t yet have a sense of what load the additional variables and >>> methods put on the system when added at the top of the hierarchy (other >>> than my laptop fan not going insane), but since the tax is on the >>> individual embedded morph for maintaining layout, I hope it is small. >>> >>> Best regards, >>> >>> Hari >>> >> >> Well, the cost is not so much loading the system, but the extra stuff that >> everybody needs to keep in our heads. >> >> Besides, there are yet more possibilities, besides Layouts in Ken's >> example. For instance, in a workspace evaluate: >> >> g _ RectangleLikeMorph new openInWorld. >> f _ EllipseMorph new. >> g morphExtent: 400@400; color: Color orange. >> g addMorph: f. >> f morphPosition: 50@50; color: Color blue. >> g morphPosition:70@70. >> >> Then, in the same workspace, try: >> g rotation: 0.0 scale: 0.5. >> >> or: >> g rotation: 0.0 scale: 2. >> >> When Morphic3 is ready, this will also work: >> g rotation: 1.0 scale: 1.0. >> The idea is that each morph can define its own coordinate system. > > That does sound interesting. > I'd like to explore how morphs can be aware of and organise themselves > around other morphs as peers (either when told about them or not.) As > organic an approach as possible. > >> Cheers, >> Juan Vuletich >> >> >>>>> On May 12, 2015, at 5:52 PM, Ken.Dickey <[hidden email]> >>>>> wrote: >>>>> >>>>> On Tue, 12 May 2015 00:24:06 -0400 >>>>> Hari Balaraman <[hidden email]> wrote: >>>>> >>>>> Hi Juan et al, >>>>> >>>>> I’ve been pondering on how to position and size morphs (based on Juan's >>>>> comment below about automatic layout in an earlier exchange) without >>>>> having an intermediate layer of layoutMorphs. >>>>> >>>>> Attached is a fileout of a test class with a class method “example 1” >>>>> showing a rectangle that varies its size based on its owner (I’m also >>>>> writing the method to reset the location of a morph if it wishes to be >>>>> remain in the same location relative to the midpoints of two sides of >>>>> the enclosing morph.) >>>>> >>>>> This way a morph can be positioned and at any time sent a message to >>>>> relocate or resize itself based on its then owner. That way there are >>>>> only two actors, the morph and its owner, and a morph knows (based on >>>>> two messages, whether it should maintain its relative place and size >>>>> within its owner. Although I have got a bit of the hang of >>>>> layoutMorphs, I’m exploring whether positioning and repositioning a lot >>>>> of elements in my UI may be easier with this approach. >>>>> >>>>> I was wondering what you think of this approach. >>>> Hari, >>>> >>>> I think we all need to get more experience building things to see what >>>> works and is as simple as we can make it. >>>> >>>> Please continue to build things and share them! >>>> >>>> Here is the example using aLayoutMorpk and a LayoutSpec. >>>> >>>> example2 >>>> " >>>> self example2. >>>> " | f g | >>>> g := LayoutMorph initializedInstance openInWorld. >>>> g padding: 0.5. "center" >>>> f := RectangleLikeMorph new. >>>> g morphExtent:400@400; color: Color orange. >>>> g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 >>>> proportionalHeight: 0.25). >>>> f morphPosition:150@150; color: Color blue. >>>> g morphPosition:70@70. >>>> >>>> >>>> Cheers, >>>> -KenD >>> >>> _______________________________________________ >>> Cuis mailing list >>> [hidden email] >>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >> > _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
Hi Hannes,
Thank you for your reply. My responses are inline. Best regards, Hari > On May 13, 2015, at 4:01 PM, H. Hirzel <[hidden email]> wrote: > > Hari, > > A suggestion: > > Maybe you can write some learner's notes written from your perspective > (questions and answers) we may add then to as a file to > > https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/tree/master/Documentation I really like that idea. I was thinking the same thing this afternoon. They will also serve to remind me of the things I (assume) I am learning. Will get back to you on that. > Tentative title > > Some suggestions for Cuis Morphic experiments for learners. > > BTW here a have a series of Layout experiments which were fine one year ago > > https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st > > I have not checked if they are still fine with the current Cuis. The > layout experiments start very simple and one builds on the other. Thanks! I will check them out. Right now I am trying to avoiding layouts (and innerpluggablemorphs etc.) like the plague :) and rebuilding my UI with the most basic pieces and looking to switch behaviour on and off as required. I like direct access when it comes to morphs and submorphs (and a sort of WYSIWIG in the ownership chain) and am still very suspicious of the value of having multiple levels of morphs contained in each other. > --Hannes > > > > On 5/13/15, Hari Balaraman <[hidden email]> wrote: >> Hi Juan, >> Thank you for your reply. >> My replies to specific points are inline. >> >>> On May 13, 2015, at 9:53 AM, Juan Vuletich <[hidden email]> wrote: >>> >>> Hi Hari, >>> >>> I think it is great that you experiment. For sure you'll learn and have >>> fun. And maybe you can contribute useful code. >> >> Hopefully soon! At this point, the only benefit to you is seeing how a >> newbie tackles the system. >> >>>> On 5/12/2015 7:19 PM, Hari Balaraman wrote: >>>> Hi Ken, >>>> >>>> Thanks for your reply. It came in just as I finished a slightly improved >>>> version of the code I presented earlier. This code moves the embedded >>>> morph in relation to the enclosing morph (by moving the centre of the >>>> embedded morph in proportion to the centre of the container morph.) I >>>> moved the variables and methods I used in the attached test class >>>> (including the stepAt method) upstream to RectangleLikeMorph to test and >>>> attach some screenshots (of that testing) when I embed an EllipseMorph >>>> into a BorderedRectMorph and switch ‘proportionalresize' off and on >>>> within the embedded morph while resizing the container morph. Thus, I >>>> maintain control over layout on a per embedded morph basis. >>>> ... >>>> I don’t yet have a sense of what load the additional variables and >>>> methods put on the system when added at the top of the hierarchy (other >>>> than my laptop fan not going insane), but since the tax is on the >>>> individual embedded morph for maintaining layout, I hope it is small. >>>> >>>> Best regards, >>>> >>>> Hari >>>> >>> >>> Well, the cost is not so much loading the system, but the extra stuff that >>> everybody needs to keep in our heads. >>> >>> Besides, there are yet more possibilities, besides Layouts in Ken's >>> example. For instance, in a workspace evaluate: >>> >>> g _ RectangleLikeMorph new openInWorld. >>> f _ EllipseMorph new. >>> g morphExtent: 400@400; color: Color orange. >>> g addMorph: f. >>> f morphPosition: 50@50; color: Color blue. >>> g morphPosition:70@70. >>> >>> Then, in the same workspace, try: >>> g rotation: 0.0 scale: 0.5. >>> >>> or: >>> g rotation: 0.0 scale: 2. >>> >>> When Morphic3 is ready, this will also work: >>> g rotation: 1.0 scale: 1.0. >>> The idea is that each morph can define its own coordinate system. >> >> That does sound interesting. >> I'd like to explore how morphs can be aware of and organise themselves >> around other morphs as peers (either when told about them or not.) As >> organic an approach as possible. >> >>> Cheers, >>> Juan Vuletich >>> >>> >>>>>> On May 12, 2015, at 5:52 PM, Ken.Dickey <[hidden email]> >>>>>> wrote: >>>>>> >>>>>> On Tue, 12 May 2015 00:24:06 -0400 >>>>>> Hari Balaraman <[hidden email]> wrote: >>>>>> >>>>>> Hi Juan et al, >>>>>> >>>>>> I’ve been pondering on how to position and size morphs (based on Juan's >>>>>> comment below about automatic layout in an earlier exchange) without >>>>>> having an intermediate layer of layoutMorphs. >>>>>> >>>>>> Attached is a fileout of a test class with a class method “example 1” >>>>>> showing a rectangle that varies its size based on its owner (I’m also >>>>>> writing the method to reset the location of a morph if it wishes to be >>>>>> remain in the same location relative to the midpoints of two sides of >>>>>> the enclosing morph.) >>>>>> >>>>>> This way a morph can be positioned and at any time sent a message to >>>>>> relocate or resize itself based on its then owner. That way there are >>>>>> only two actors, the morph and its owner, and a morph knows (based on >>>>>> two messages, whether it should maintain its relative place and size >>>>>> within its owner. Although I have got a bit of the hang of >>>>>> layoutMorphs, I’m exploring whether positioning and repositioning a lot >>>>>> of elements in my UI may be easier with this approach. >>>>>> >>>>>> I was wondering what you think of this approach. >>>>> Hari, >>>>> >>>>> I think we all need to get more experience building things to see what >>>>> works and is as simple as we can make it. >>>>> >>>>> Please continue to build things and share them! >>>>> >>>>> Here is the example using aLayoutMorpk and a LayoutSpec. >>>>> >>>>> example2 >>>>> " >>>>> self example2. >>>>> " | f g | >>>>> g := LayoutMorph initializedInstance openInWorld. >>>>> g padding: 0.5. "center" >>>>> f := RectangleLikeMorph new. >>>>> g morphExtent:400@400; color: Color orange. >>>>> g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 >>>>> proportionalHeight: 0.25). >>>>> f morphPosition:150@150; color: Color blue. >>>>> g morphPosition:70@70. >>>>> >>>>> >>>>> Cheers, >>>>> -KenD >>>> >>>> _______________________________________________ >>>> Cuis mailing list >>>> [hidden email] >>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >>> >> > > _______________________________________________ > Cuis mailing list > [hidden email] > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
I suggest that you really have a look at
https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st They are _really_ basic. No plague.... At least you learn for example how to put a SystemWindow around your morphs and have a tool bar. Which is a good thing to know. HH On 5/13/15, Hari Balaraman <[hidden email]> wrote: > Hi Hannes, > Thank you for your reply. My responses are inline. > Best regards, > Hari > >> On May 13, 2015, at 4:01 PM, H. Hirzel <[hidden email]> wrote: >> >> Hari, >> >> A suggestion: >> >> Maybe you can write some learner's notes written from your perspective >> (questions and answers) we may add then to as a file to >> >> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/tree/master/Documentation > > I really like that idea. I was thinking the same thing this afternoon. They > will also serve to remind me of the things I (assume) I am learning. Will > get back to you on that. > >> Tentative title >> >> Some suggestions for Cuis Morphic experiments for learners. >> >> BTW here a have a series of Layout experiments which were fine one year >> ago >> >> https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st >> >> I have not checked if they are still fine with the current Cuis. The >> layout experiments start very simple and one builds on the other. > > Thanks! I will check them out. Right now I am trying to avoiding layouts > (and innerpluggablemorphs etc.) like the plague :) and rebuilding my UI with > the most basic pieces and looking to switch behaviour on and off as > required. I like direct access when it comes to morphs and submorphs (and a > sort of WYSIWIG in the ownership chain) and am still very suspicious of the > value of having multiple levels of morphs contained in each other. > >> --Hannes >> >> >> >> On 5/13/15, Hari Balaraman <[hidden email]> wrote: >>> Hi Juan, >>> Thank you for your reply. >>> My replies to specific points are inline. >>> >>>> On May 13, 2015, at 9:53 AM, Juan Vuletich <[hidden email]> wrote: >>>> >>>> Hi Hari, >>>> >>>> I think it is great that you experiment. For sure you'll learn and have >>>> fun. And maybe you can contribute useful code. >>> >>> Hopefully soon! At this point, the only benefit to you is seeing how a >>> newbie tackles the system. >>> >>>>> On 5/12/2015 7:19 PM, Hari Balaraman wrote: >>>>> Hi Ken, >>>>> >>>>> Thanks for your reply. It came in just as I finished a slightly >>>>> improved >>>>> version of the code I presented earlier. This code moves the embedded >>>>> morph in relation to the enclosing morph (by moving the centre of the >>>>> embedded morph in proportion to the centre of the container morph.) I >>>>> moved the variables and methods I used in the attached test class >>>>> (including the stepAt method) upstream to RectangleLikeMorph to test >>>>> and >>>>> attach some screenshots (of that testing) when I embed an EllipseMorph >>>>> into a BorderedRectMorph and switch ‘proportionalresize' off and on >>>>> within the embedded morph while resizing the container morph. Thus, I >>>>> maintain control over layout on a per embedded morph basis. >>>>> ... >>>>> I don’t yet have a sense of what load the additional variables and >>>>> methods put on the system when added at the top of the hierarchy (other >>>>> than my laptop fan not going insane), but since the tax is on the >>>>> individual embedded morph for maintaining layout, I hope it is small. >>>>> >>>>> Best regards, >>>>> >>>>> Hari >>>>> >>>> >>>> Well, the cost is not so much loading the system, but the extra stuff >>>> that >>>> everybody needs to keep in our heads. >>>> >>>> Besides, there are yet more possibilities, besides Layouts in Ken's >>>> example. For instance, in a workspace evaluate: >>>> >>>> g _ RectangleLikeMorph new openInWorld. >>>> f _ EllipseMorph new. >>>> g morphExtent: 400@400; color: Color orange. >>>> g addMorph: f. >>>> f morphPosition: 50@50; color: Color blue. >>>> g morphPosition:70@70. >>>> >>>> Then, in the same workspace, try: >>>> g rotation: 0.0 scale: 0.5. >>>> >>>> or: >>>> g rotation: 0.0 scale: 2. >>>> >>>> When Morphic3 is ready, this will also work: >>>> g rotation: 1.0 scale: 1.0. >>>> The idea is that each morph can define its own coordinate system. >>> >>> That does sound interesting. >>> I'd like to explore how morphs can be aware of and organise themselves >>> around other morphs as peers (either when told about them or not.) As >>> organic an approach as possible. >>> >>>> Cheers, >>>> Juan Vuletich >>>> >>>> >>>>>>> On May 12, 2015, at 5:52 PM, Ken.Dickey <[hidden email]> >>>>>>> wrote: >>>>>>> >>>>>>> On Tue, 12 May 2015 00:24:06 -0400 >>>>>>> Hari Balaraman <[hidden email]> wrote: >>>>>>> >>>>>>> Hi Juan et al, >>>>>>> >>>>>>> I’ve been pondering on how to position and size morphs (based on >>>>>>> Juan's >>>>>>> comment below about automatic layout in an earlier exchange) without >>>>>>> having an intermediate layer of layoutMorphs. >>>>>>> >>>>>>> Attached is a fileout of a test class with a class method “example 1” >>>>>>> showing a rectangle that varies its size based on its owner (I’m also >>>>>>> writing the method to reset the location of a morph if it wishes to >>>>>>> be >>>>>>> remain in the same location relative to the midpoints of two sides of >>>>>>> the enclosing morph.) >>>>>>> >>>>>>> This way a morph can be positioned and at any time sent a message to >>>>>>> relocate or resize itself based on its then owner. That way there are >>>>>>> only two actors, the morph and its owner, and a morph knows (based on >>>>>>> two messages, whether it should maintain its relative place and size >>>>>>> within its owner. Although I have got a bit of the hang of >>>>>>> layoutMorphs, I’m exploring whether positioning and repositioning a >>>>>>> lot >>>>>>> of elements in my UI may be easier with this approach. >>>>>>> >>>>>>> I was wondering what you think of this approach. >>>>>> Hari, >>>>>> >>>>>> I think we all need to get more experience building things to see what >>>>>> works and is as simple as we can make it. >>>>>> >>>>>> Please continue to build things and share them! >>>>>> >>>>>> Here is the example using aLayoutMorpk and a LayoutSpec. >>>>>> >>>>>> example2 >>>>>> " >>>>>> self example2. >>>>>> " | f g | >>>>>> g := LayoutMorph initializedInstance openInWorld. >>>>>> g padding: 0.5. "center" >>>>>> f := RectangleLikeMorph new. >>>>>> g morphExtent:400@400; color: Color orange. >>>>>> g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 >>>>>> proportionalHeight: 0.25). >>>>>> f morphPosition:150@150; color: Color blue. >>>>>> g morphPosition:70@70. >>>>>> >>>>>> >>>>>> Cheers, >>>>>> -KenD >>>>> >>>>> _______________________________________________ >>>>> Cuis mailing list >>>>> [hidden email] >>>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >>>> >>> >> >> _______________________________________________ >> Cuis mailing list >> [hidden email] >> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org > > > _______________________________________________ > Cuis mailing list > [hidden email] > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org > _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
P.S. I hope that Cuis has not changed to much that you run into
compatibility issues. As I wrote I did not do a retest of it in the last 12 months. On 5/13/15, H. Hirzel <[hidden email]> wrote: > I suggest that you really have a look at > > https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st > > They are _really_ basic. No plague.... > > At least you learn for example how to put a SystemWindow around your > morphs and have a tool bar. Which is a good thing to know. > > HH > > On 5/13/15, Hari Balaraman <[hidden email]> wrote: >> Hi Hannes, >> Thank you for your reply. My responses are inline. >> Best regards, >> Hari >> >>> On May 13, 2015, at 4:01 PM, H. Hirzel <[hidden email]> wrote: >>> >>> Hari, >>> >>> A suggestion: >>> >>> Maybe you can write some learner's notes written from your perspective >>> (questions and answers) we may add then to as a file to >>> >>> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/tree/master/Documentation >> >> I really like that idea. I was thinking the same thing this afternoon. >> They >> will also serve to remind me of the things I (assume) I am learning. Will >> get back to you on that. >> >>> Tentative title >>> >>> Some suggestions for Cuis Morphic experiments for learners. >>> >>> BTW here a have a series of Layout experiments which were fine one year >>> ago >>> >>> https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st >>> >>> I have not checked if they are still fine with the current Cuis. The >>> layout experiments start very simple and one builds on the other. >> >> Thanks! I will check them out. Right now I am trying to avoiding layouts >> (and innerpluggablemorphs etc.) like the plague :) and rebuilding my UI >> with >> the most basic pieces and looking to switch behaviour on and off as >> required. I like direct access when it comes to morphs and submorphs (and >> a >> sort of WYSIWIG in the ownership chain) and am still very suspicious of >> the >> value of having multiple levels of morphs contained in each other. >> >>> --Hannes >>> >>> >>> >>> On 5/13/15, Hari Balaraman <[hidden email]> wrote: >>>> Hi Juan, >>>> Thank you for your reply. >>>> My replies to specific points are inline. >>>> >>>>> On May 13, 2015, at 9:53 AM, Juan Vuletich <[hidden email]> wrote: >>>>> >>>>> Hi Hari, >>>>> >>>>> I think it is great that you experiment. For sure you'll learn and >>>>> have >>>>> fun. And maybe you can contribute useful code. >>>> >>>> Hopefully soon! At this point, the only benefit to you is seeing how a >>>> newbie tackles the system. >>>> >>>>>> On 5/12/2015 7:19 PM, Hari Balaraman wrote: >>>>>> Hi Ken, >>>>>> >>>>>> Thanks for your reply. It came in just as I finished a slightly >>>>>> improved >>>>>> version of the code I presented earlier. This code moves the embedded >>>>>> morph in relation to the enclosing morph (by moving the centre of the >>>>>> embedded morph in proportion to the centre of the container morph.) I >>>>>> moved the variables and methods I used in the attached test class >>>>>> (including the stepAt method) upstream to RectangleLikeMorph to test >>>>>> and >>>>>> attach some screenshots (of that testing) when I embed an >>>>>> EllipseMorph >>>>>> into a BorderedRectMorph and switch ‘proportionalresize' off and on >>>>>> within the embedded morph while resizing the container morph. Thus, I >>>>>> maintain control over layout on a per embedded morph basis. >>>>>> ... >>>>>> I don’t yet have a sense of what load the additional variables and >>>>>> methods put on the system when added at the top of the hierarchy >>>>>> (other >>>>>> than my laptop fan not going insane), but since the tax is on the >>>>>> individual embedded morph for maintaining layout, I hope it is small. >>>>>> >>>>>> Best regards, >>>>>> >>>>>> Hari >>>>>> >>>>> >>>>> Well, the cost is not so much loading the system, but the extra stuff >>>>> that >>>>> everybody needs to keep in our heads. >>>>> >>>>> Besides, there are yet more possibilities, besides Layouts in Ken's >>>>> example. For instance, in a workspace evaluate: >>>>> >>>>> g _ RectangleLikeMorph new openInWorld. >>>>> f _ EllipseMorph new. >>>>> g morphExtent: 400@400; color: Color orange. >>>>> g addMorph: f. >>>>> f morphPosition: 50@50; color: Color blue. >>>>> g morphPosition:70@70. >>>>> >>>>> Then, in the same workspace, try: >>>>> g rotation: 0.0 scale: 0.5. >>>>> >>>>> or: >>>>> g rotation: 0.0 scale: 2. >>>>> >>>>> When Morphic3 is ready, this will also work: >>>>> g rotation: 1.0 scale: 1.0. >>>>> The idea is that each morph can define its own coordinate system. >>>> >>>> That does sound interesting. >>>> I'd like to explore how morphs can be aware of and organise themselves >>>> around other morphs as peers (either when told about them or not.) As >>>> organic an approach as possible. >>>> >>>>> Cheers, >>>>> Juan Vuletich >>>>> >>>>> >>>>>>>> On May 12, 2015, at 5:52 PM, Ken.Dickey <[hidden email]> >>>>>>>> wrote: >>>>>>>> >>>>>>>> On Tue, 12 May 2015 00:24:06 -0400 >>>>>>>> Hari Balaraman <[hidden email]> wrote: >>>>>>>> >>>>>>>> Hi Juan et al, >>>>>>>> >>>>>>>> I’ve been pondering on how to position and size morphs (based on >>>>>>>> Juan's >>>>>>>> comment below about automatic layout in an earlier exchange) >>>>>>>> without >>>>>>>> having an intermediate layer of layoutMorphs. >>>>>>>> >>>>>>>> Attached is a fileout of a test class with a class method “example >>>>>>>> 1” >>>>>>>> showing a rectangle that varies its size based on its owner (I’m >>>>>>>> also >>>>>>>> writing the method to reset the location of a morph if it wishes to >>>>>>>> be >>>>>>>> remain in the same location relative to the midpoints of two sides >>>>>>>> of >>>>>>>> the enclosing morph.) >>>>>>>> >>>>>>>> This way a morph can be positioned and at any time sent a message >>>>>>>> to >>>>>>>> relocate or resize itself based on its then owner. That way there >>>>>>>> are >>>>>>>> only two actors, the morph and its owner, and a morph knows (based >>>>>>>> on >>>>>>>> two messages, whether it should maintain its relative place and >>>>>>>> size >>>>>>>> within its owner. Although I have got a bit of the hang of >>>>>>>> layoutMorphs, I’m exploring whether positioning and repositioning a >>>>>>>> lot >>>>>>>> of elements in my UI may be easier with this approach. >>>>>>>> >>>>>>>> I was wondering what you think of this approach. >>>>>>> Hari, >>>>>>> >>>>>>> I think we all need to get more experience building things to see >>>>>>> what >>>>>>> works and is as simple as we can make it. >>>>>>> >>>>>>> Please continue to build things and share them! >>>>>>> >>>>>>> Here is the example using aLayoutMorpk and a LayoutSpec. >>>>>>> >>>>>>> example2 >>>>>>> " >>>>>>> self example2. >>>>>>> " | f g | >>>>>>> g := LayoutMorph initializedInstance openInWorld. >>>>>>> g padding: 0.5. "center" >>>>>>> f := RectangleLikeMorph new. >>>>>>> g morphExtent:400@400; color: Color orange. >>>>>>> g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 >>>>>>> proportionalHeight: 0.25). >>>>>>> f morphPosition:150@150; color: Color blue. >>>>>>> g morphPosition:70@70. >>>>>>> >>>>>>> >>>>>>> Cheers, >>>>>>> -KenD >>>>>> >>>>>> _______________________________________________ >>>>>> Cuis mailing list >>>>>> [hidden email] >>>>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >>>>> >>>> >>> >>> _______________________________________________ >>> Cuis mailing list >>> [hidden email] >>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >> >> >> _______________________________________________ >> Cuis mailing list >> [hidden email] >> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >> > _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
In reply to this post by Hannes Hirzel
No plague! Hari, put down those antibiotics....
Seriously, thanks much for the suggestions. H > On May 13, 2015, at 4:31 PM, H. Hirzel <[hidden email]> wrote: > > I suggest that you really have a look at > > https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st > > They are _really_ basic. No plague.... > > At least you learn for example how to put a SystemWindow around your > morphs and have a tool bar. Which is a good thing to know. > > HH > >> On 5/13/15, Hari Balaraman <[hidden email]> wrote: >> Hi Hannes, >> Thank you for your reply. My responses are inline. >> Best regards, >> Hari >> >>> On May 13, 2015, at 4:01 PM, H. Hirzel <[hidden email]> wrote: >>> >>> Hari, >>> >>> A suggestion: >>> >>> Maybe you can write some learner's notes written from your perspective >>> (questions and answers) we may add then to as a file to >>> >>> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/tree/master/Documentation >> >> I really like that idea. I was thinking the same thing this afternoon. They >> will also serve to remind me of the things I (assume) I am learning. Will >> get back to you on that. >> >>> Tentative title >>> >>> Some suggestions for Cuis Morphic experiments for learners. >>> >>> BTW here a have a series of Layout experiments which were fine one year >>> ago >>> >>> https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st >>> >>> I have not checked if they are still fine with the current Cuis. The >>> layout experiments start very simple and one builds on the other. >> >> Thanks! I will check them out. Right now I am trying to avoiding layouts >> (and innerpluggablemorphs etc.) like the plague :) and rebuilding my UI with >> the most basic pieces and looking to switch behaviour on and off as >> required. I like direct access when it comes to morphs and submorphs (and a >> sort of WYSIWIG in the ownership chain) and am still very suspicious of the >> value of having multiple levels of morphs contained in each other. >> >>> --Hannes >>> >>> >>> >>>> On 5/13/15, Hari Balaraman <[hidden email]> wrote: >>>> Hi Juan, >>>> Thank you for your reply. >>>> My replies to specific points are inline. >>>> >>>>> On May 13, 2015, at 9:53 AM, Juan Vuletich <[hidden email]> wrote: >>>>> >>>>> Hi Hari, >>>>> >>>>> I think it is great that you experiment. For sure you'll learn and have >>>>> fun. And maybe you can contribute useful code. >>>> >>>> Hopefully soon! At this point, the only benefit to you is seeing how a >>>> newbie tackles the system. >>>> >>>>>> On 5/12/2015 7:19 PM, Hari Balaraman wrote: >>>>>> Hi Ken, >>>>>> >>>>>> Thanks for your reply. It came in just as I finished a slightly >>>>>> improved >>>>>> version of the code I presented earlier. This code moves the embedded >>>>>> morph in relation to the enclosing morph (by moving the centre of the >>>>>> embedded morph in proportion to the centre of the container morph.) I >>>>>> moved the variables and methods I used in the attached test class >>>>>> (including the stepAt method) upstream to RectangleLikeMorph to test >>>>>> and >>>>>> attach some screenshots (of that testing) when I embed an EllipseMorph >>>>>> into a BorderedRectMorph and switch ‘proportionalresize' off and on >>>>>> within the embedded morph while resizing the container morph. Thus, I >>>>>> maintain control over layout on a per embedded morph basis. >>>>>> ... >>>>>> I don’t yet have a sense of what load the additional variables and >>>>>> methods put on the system when added at the top of the hierarchy (other >>>>>> than my laptop fan not going insane), but since the tax is on the >>>>>> individual embedded morph for maintaining layout, I hope it is small. >>>>>> >>>>>> Best regards, >>>>>> >>>>>> Hari >>>>> >>>>> Well, the cost is not so much loading the system, but the extra stuff >>>>> that >>>>> everybody needs to keep in our heads. >>>>> >>>>> Besides, there are yet more possibilities, besides Layouts in Ken's >>>>> example. For instance, in a workspace evaluate: >>>>> >>>>> g _ RectangleLikeMorph new openInWorld. >>>>> f _ EllipseMorph new. >>>>> g morphExtent: 400@400; color: Color orange. >>>>> g addMorph: f. >>>>> f morphPosition: 50@50; color: Color blue. >>>>> g morphPosition:70@70. >>>>> >>>>> Then, in the same workspace, try: >>>>> g rotation: 0.0 scale: 0.5. >>>>> >>>>> or: >>>>> g rotation: 0.0 scale: 2. >>>>> >>>>> When Morphic3 is ready, this will also work: >>>>> g rotation: 1.0 scale: 1.0. >>>>> The idea is that each morph can define its own coordinate system. >>>> >>>> That does sound interesting. >>>> I'd like to explore how morphs can be aware of and organise themselves >>>> around other morphs as peers (either when told about them or not.) As >>>> organic an approach as possible. >>>> >>>>> Cheers, >>>>> Juan Vuletich >>>>> >>>>> >>>>>>>> On May 12, 2015, at 5:52 PM, Ken.Dickey <[hidden email]> >>>>>>>> wrote: >>>>>>>> >>>>>>>> On Tue, 12 May 2015 00:24:06 -0400 >>>>>>>> Hari Balaraman <[hidden email]> wrote: >>>>>>>> >>>>>>>> Hi Juan et al, >>>>>>>> >>>>>>>> I’ve been pondering on how to position and size morphs (based on >>>>>>>> Juan's >>>>>>>> comment below about automatic layout in an earlier exchange) without >>>>>>>> having an intermediate layer of layoutMorphs. >>>>>>>> >>>>>>>> Attached is a fileout of a test class with a class method “example 1” >>>>>>>> showing a rectangle that varies its size based on its owner (I’m also >>>>>>>> writing the method to reset the location of a morph if it wishes to >>>>>>>> be >>>>>>>> remain in the same location relative to the midpoints of two sides of >>>>>>>> the enclosing morph.) >>>>>>>> >>>>>>>> This way a morph can be positioned and at any time sent a message to >>>>>>>> relocate or resize itself based on its then owner. That way there are >>>>>>>> only two actors, the morph and its owner, and a morph knows (based on >>>>>>>> two messages, whether it should maintain its relative place and size >>>>>>>> within its owner. Although I have got a bit of the hang of >>>>>>>> layoutMorphs, I’m exploring whether positioning and repositioning a >>>>>>>> lot >>>>>>>> of elements in my UI may be easier with this approach. >>>>>>>> >>>>>>>> I was wondering what you think of this approach. >>>>>>> Hari, >>>>>>> >>>>>>> I think we all need to get more experience building things to see what >>>>>>> works and is as simple as we can make it. >>>>>>> >>>>>>> Please continue to build things and share them! >>>>>>> >>>>>>> Here is the example using aLayoutMorpk and a LayoutSpec. >>>>>>> >>>>>>> example2 >>>>>>> " >>>>>>> self example2. >>>>>>> " | f g | >>>>>>> g := LayoutMorph initializedInstance openInWorld. >>>>>>> g padding: 0.5. "center" >>>>>>> f := RectangleLikeMorph new. >>>>>>> g morphExtent:400@400; color: Color orange. >>>>>>> g addMorph: f layoutSpec: (LayoutSpec proportionalWidth: 0.25 >>>>>>> proportionalHeight: 0.25). >>>>>>> f morphPosition:150@150; color: Color blue. >>>>>>> g morphPosition:70@70. >>>>>>> >>>>>>> >>>>>>> Cheers, >>>>>>> -KenD >>>>>> >>>>>> _______________________________________________ >>>>>> Cuis mailing list >>>>>> [hidden email] >>>>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >>> >>> _______________________________________________ >>> Cuis mailing list >>> [hidden email] >>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org >> >> >> _______________________________________________ >> Cuis mailing list >> [hidden email] >> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org > > _______________________________________________ > Cuis mailing list > [hidden email] > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
In reply to this post by hbalaraman
... Now _that_ is interesting! Keep us posted. Cheers, Juan Vuletich _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
In reply to this post by Hannes Hirzel
Please retest and keep it updated!
Cheers, Juan Vuletich On 5/13/2015 5:32 PM, H. Hirzel wrote: > P.S. I hope that Cuis has not changed to much that you run into > compatibility issues. As I wrote I did not do a retest of it in the > last 12 months. > > On 5/13/15, H. Hirzel<[hidden email]> wrote: >> I suggest that you really have a look at >> >> https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st >> >> They are _really_ basic. No plague.... >> >> At least you learn for example how to put a SystemWindow around your >> morphs and have a tool bar. Which is a good thing to know. >> >> HH _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
Free forum by Nabble | Edit this page |