[Cuis] Newbie question

Juan Vuletich juan at jvuletich.org
Mon Mar 30 07:51:28 CDT 2015


Hi Folks,

On 3/28/2015 11:26 PM, Ken.Dickey wrote:
> On Sat, 28 Mar 2015 18:47:04 -0400
> "Phil (list)"<pbpublist at gmail.com>  wrote:
>
>>> I’ve been looking up Squeak/Pharo/Cuis documentation on using layouts
>>> (which may be the issue) but have made little headway.
> Cuis layouts are different from Squeak or Pharo.  Given the changes going on, many things require some code reading and playing around.
>
> To understand Layouts and LayoutSpecs, I did simple editors for them.  They are located in the Morphic-Misc1 package at:
>    https://github.com/KenDickey/Cuis-Smalltalk-Morphic-Misc1
>
>  From the readme:
> "
> After loading this package, one can select a morph, open its menu from the halo, and edit its LayoutSpec.
> If the morph is a LayoutMorph, one can also open an editor for the LayoutMorph from the halo menu.
> "
>
> Inspecting the window submorphs should help as well.
>
> Cheers,
> -KenD

Hari, you were really close. Unfortunately, a bug in Cuis made it harder 
than needed. Besides trying Ken suggestion, also do the following:

1) Change #addToScroller: to read
addToScroller: aMorph

     scroller
         addMorph: aMorph position: 0 at 0;
         morphExtent: aMorph morphExtent

(just found a bug. This fix will be on GitHub soon)

2) Take a look at #inATwoWayScrollPane. Try the comment:

(EllipseMorph new morphExtent: 500 at 270) inATwoWayScrollPane openInHand

3) Change your code to read:
mArea := ( DragAndDropAreaMorph new color: Color white) inspect openInWorld.
scrollpane := (PluggableScrollPane new color: Color red) openInWorld .
scrollpane inspect.
gWindow := SystemWindow new.
gWindow addMorph: scrollpane.

mArea morphExtent: 800 at 800.
scrollpane addToScroller: mArea.

qEllipse := EllipseMorph new.
mArea addMorph: qEllipse.
qEllipse morphPosition: 200 at 500.

gWindow openInWorld

The change was to set the mArea extent prior to adding to the 
scroller.... Maybe we'd make InnerPluggableMorph>>#adjustExtent work! If 
you keep playing with this, and find out whow you think it should 
behave, please send us your code, for integration.

Cheers,
Juan Vuletich





More information about the Cuis mailing list