Hi Alistair, 2016-09-01 10:38 GMT+02:00 Alistair Grant <akgrant0...@gmail.com>:
> If I have a CompositeModel which I want to display as a tab in a GT > Inspector, what should the inspector method look like? (I haven't been > able to find any examples in the image or on the web) > > I assume it should be something like: > > > gtInspectEditIn: composite > <gtInspectorPresentationOrder: 50> > > ^ composite spec > title: 'Edit'; > display: [ :anObject | MyCompositeModelEditor on: anObject ]. > > > But it isn't clear to me what the display block should be returning. > The model *after* building the widget with #buildWithSpec > > I can successfully open the window using: > > > MyCompositeModelEditor new > editObject: anObject; > openWithSpec. > > Here is an example how you can create a spec based presentation (an IconListModel) ). Add this method to the other gtInspectorMethods for class Morph (instance side): gtInspectorSubmorphs2In: composite <gtInspectorPresentationOrder: 80> composite spec title: 'Submorphs2'; display: [:each ||lm| lm:= IconListModel new. lm items: each submorphs. lm icons:[:item | item taskThumbnailOfSize: (16@16) ]. lm displayBlock:[:item | item printString -> item class name]. lm buildWithSpec. lm ] > > Thanks, > Alistair > >