On 19.04.2010, at 11:45, Hannes Hirzel wrote: > > Hello > > I would like to construct a three pane browser to inspect a dictionary > of dictionaries (see data structure example code below). How do I do > this using the ToolBuilder? I would like to learn to use it. > > The class comment of ToolBuilder > "I am a tool builder, that is an object which knows how to create > concrete widgets from abstract specifications. Those specifications > are used by tools which want to be able to function in diverse user > interface paradigms, such as MVC, Morphic, Tweak, wxWidgets etc" > > What I have done so far it to construct a two pane browser for > browsing a dictionary showing only the keys not the instance > variables. I did this by subclassing DictionaryInspector and > overriding 4 methods. (see screen shot) > > I assume for the Three pane browser I'd have to construct a three pane > browser from scratch using ToolBuilder. > > myLessons := Dictionary new. > > myLessons at: 'lesson1' put: ((((Dictionary new > at: 'section1' put: 'the string for section 1 of lesson01'; yourself) > at: 'section2' put: 'the string for section 2 of lesson01'; yourself) > at: 'section3' put: 'the string for section 3 of lesson01'; yourself)). > > myLessons at: 'lesson2' put: (((((Dictionary new > at: 'section1' put: 'the string for section 1 of lesson2'; yourself) > at: 'section2' put: 'the string for section 2 of lesson2'; yourself) > at: 'section3' put: 'the string for section 3 of lesson2'; yourself)) > at: 'section4' put: 'the string for section 4 of lesson2'; yourself). > > myLessons at: 'lesson3' put: ((((Dictionary new > at: 'section1' put: 'the string for section 1 of lesson3'; yourself) > at: 'section2' put: 'the string for section 2 of lesson3'; yourself) > at: 'section3' put: 'the string for section 3 of lesson3'; yourself)). > > myLessons explore > > Thank you for suggestions/hints or maybe just the answer in advance. > For me this is an example for constructing more complex things. > > Hannes
Maybe look at Browser>>buildWith: or all the other buildWith: implementations? No need to subclass DictionaryInspector, I'd simply subclass Model. You would have two lists, and a text pane. Your model will have to provide methods to get the list and get/set the current index. E.g. #lessonList, #lessonListIndex, #lessonListIndex: and #sectionList, #sectionListIndex, #sectionListIndex:. When you select something in the lesson list, #lessonListIndex: will be sent. In response, you would send "self changed: #sectionList" which will cause the section list to be updated. Etc. - Bert - _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners