Sunday, January 10, 2010

TreeMorph based package browser

In this tutorial you will learn how to display packages / class / messages tree in a TreeMorph and use the Selected callbalk to display source code of selected item in a TextMorph.

Download screencast (800x600): .mpeg, 22.4 MB, .mov, 41.1 MB

Load the source code:
Gofer new
     squeaksource: 'Pharocasts';
     package: 'TreeMorphBasedPackageBrowser';

Code samples:
aTreeMorph := PluggableTreeMorph new.
items := PackageOrganizer default packages collect: [:aPackageInfo|
   PackageInfoListItemWrapper with: aPackageInfo.
aTreeMorph list: items.
   model: self;
   setSelectedSelector: #onItemWrapperClick:.

In PackageInfoListItemWrapper:
   ^ item classes collect: [:aClass | ClassDescriptionListItemWrapper with: aClass].

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.