[Q][3.8][Morphic][Doc] How do I use the PluggableTabBarMorph?

karl.ramberg at chello.se karl.ramberg at chello.se
Wed Dec 15 08:05:05 UTC 2004


Hannes Hirzel <hhzl at bluewin.ch> wrote:

> Hi
> 
> I am looking for an simple example how to use the PluggableTabBarMorph.
> 
> In the class comment I find
> 
> 
> (PluggableTabBarMorph on: nil)
> 	addTab: (Text fromString: 'Test') withAction: [Transcript show: 'Test'; 
> cr];
> 	addTab: (Text fromString: 'Another') withAction: [Transcript show: 
> 'Another'; cr];
> 	width: 200;
> 	openInHand
> 
> 
> I need something more elaborate
> 
> 
> Five tabs  'Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5'
> 
> with 5 PasteUpMorphs
> where the users can paste morphs on.
> 
> 
> In David Shaffers keymapping tool a tabbed morph is used but it uses a 
> list where the content is exchanged when a user clicks on a tab.
> This is currently too complex for me to serve as an example.
> 
> It is probably not more than 30 loc.
> 
> Does anybody have this handy? Or a pointer?
> 
> I will put the result as a receipe on the swiki.
> 
> Thank you

The BFAV uses the tab buttons like this
PatchArchiveClient>>buildTabBarMorph
	| tabBar |
	
	tabBar _ PluggableTabBarMorph on: self.
	self tabBarButtonSpecs do: [ :spec |
		tabBar addTab: spec first withAction: spec second. ].
	^ tabBar


PatchArchiveClient>>tabBarButtonSpecs
	
	^ { 
		{ 'Bugs'. #swapInBugListing.}.
	     { 'Unreviewed'.  #swapInUnreviewedListing.}.
		 { 'Conflicts'.  #swapInConflicts. }.
	     { 'Reviewed'.  #swapInReviewedListing. }.
	     { 'Approved'.  #swapInApprovedListing. }.
	     { 'Update'. #swapInUpdateListing. }.
	     { 'Closed'.  #swapInClosedListing. }.
	     { 'All'.  #swapInAllListing. }.
	   }

Karl



More information about the Squeak-dev mailing list