Code Monkey home page Code Monkey logo

Comments (3)

hhzl avatar hhzl commented on May 25, 2024

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.

from cuis-smalltalk-dev.

hhzl avatar hhzl commented on May 25, 2024

More notes:

H. Hirzel
[email protected] Fri, May 15, 2015 at 8:05 AM
To: Juan Vuletich [email protected]
Cc: Discussion of Cuis Smalltalk [email protected]

I tested all examples in

https://github.com/hhzl/Cuis-Add-Ons/blob/master/Add-Ons-LayoutDemo.pck.st

in the recent Cuis4.2-2243.image

and all work as they did a year ago

For example we have LayoutDemo0 which shows how to subclass
SystemWindow and set the window title.

  1. Subclass SystemWindow

  2. Create initialize method

    initialize

          super initialize.
    
          self buildMorphicWindow.
    
  3. Define your #buildMorphicWindow method

          buildMorphicWindow
    
          self setLabel: self className
    

A simplified variant of LayoutDemo1b is to have step number 3 do the following:

  1. Define your #buildMorphicWindow method

    buildMorphicWindow
    
         self setLabel: self className.
         self layoutMorph  addMorph:
                           (DragAndDropAreaMorph new color: Color green).
    

This gives you a Window in which you can drop other morphs. A nice way
to keep Morph examples around.

So or with a code snippet from an earlier mail in this thread.

  buildMorphicWindow


     | f g |

        self setLabel: self className.


        g _ RectangleLikeMorph new.
        f _ EllipseMorph new.
        g morphExtent: 400@400; color: Color orange.
        g addMorph: f.
        f morphPosition: 50@50; color: Color blue.
        g morphPosition:70@70.


        self layoutMorph  addMorph: g

from cuis-smalltalk-dev.

hhzl avatar hhzl commented on May 25, 2024

@KenDickey : Thank you for

https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/LayoutUsage.md

from cuis-smalltalk-dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.