Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Recipe: Graphical display of all projects
Last updated at 8:25 am UTC on 24 February 2018

The problem


You want to have a graphical overview panel of all your projects.

Solution


Paste the following code snippet into a Workspace and execute it

 p := PasteUpMorph new.
 p extent: 800@600.
 p layoutPolicy: TableLayout new.
 p listDirection: #leftToRight.
 p wrapCentering: #topLeft.
 p wrapDirection: #topToBottom.
 Project allNames do: 
   [ :aName | p addMorph: 
 	(ProjectViewMorph on: (Project named: aName)) ].
 p color: Color green.
 p openInWorld.


You get a PasteUpMorph which includes buttons to jump to a specific Project.




The same wrapped with a SystemWindow and a ScrollPane


p := PasteUpMorph new.
p extent: 600@1000.
p layoutPolicy: TableLayout new.
p listDirection: #leftToRight.
p wrapCentering: #topLeft.
p wrapDirection: #topToBottom.


p layoutPolicy: TableLayout new;
    listDirection: #topToBottom;
    color: Color white.
sp := ScrollPane new extent: 600@500.
sp scroller addMorph: p.

Project allNames asSortedCollection do: 
  [ :aName | p addMorph: 
	(ProjectViewMorph on: (Project named: aName)) ].
p color: Color green.

sp openInWindow.
sp setScrollDeltas.


This code was adapted from
Recipe: Create a window with scrollable contents - example 4