Search code examples
objective-ccocoasmalltalkpharomorphic

What is the difference between a Morph in Morphic and a NSView in Cocoa?


I'd like to know about the things that make Morphic special.


Solution

  • Morphic is much more than NSView or any other graphics class that simply allow the re-implementation of a limited set of features. Morphic is an extremely malleable UI construction kit. Some design ideas behind Morphic makes this intention clear:

    • A comprehensive hierarchy of 2D coordinate systems is included. They are not restricted to Cartesian or linear. Useful nonlinear coordinate systems include polar, logarithmic,hyperbolic and geographic (map like) projections.
    • Separation of the handling of coordinate systems from the morphs themselves. A morph should only need to select its preferred coordinate system, instead of needing to convert every point it draws to World coordinates by itself. Its #drawOn: method and the location of its sub-morphs are expressed in its own coordinate system.
    • Complete independency of Display properties such as size or resolution. There is no concept of pixel. The GUI is thought at a higher level. All the GUI is independent of pixel resolution. All the rendering is anti aliased.
    • Separating the coordinate system eases the moving, zooming and rotation of morphs.
    • All coordinates are Float numbers. This is good for allowing completely arbitrary scales without significant rounding errors.
    • The Morph hierarchy is not a hierarchy of shapes. Morphs don't have a concept of a border or color. There is no general concept of submorph aligning. A particular morph may implement these in any way that makes sense for itself.
    • Morphic event handling is flexible and allows you to send events to arbitrary objects. That object need not subclass Morph.