[Cuis] Newbie question

H. Hirzel hannes.hirzel at gmail.com
Fri May 15 01:05:09 CDT 2015


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:


3. 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 at 400; color: Color orange.
      g addMorph: f.
      f morphPosition: 50 at 50; color: Color blue.
      g morphPosition:70 at 70.
	
	
 	self layoutMorph  addMorph: g



--Hannes

On 5/14/15, Juan Vuletich <juan at jvuletich.org> wrote:
> 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<hannes.hirzel at gmail.com>  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
>
>




More information about the Cuis mailing list