Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!sdd.hp.com!decwrl!pa.dec.com!nntpd.lkg.dec.com!ranger.enet.dec.com!minow From: minow@ranger.enet.dec.com (Martin Minow) Newsgroups: comp.sys.mac.programmer Subject: Re: List Mgr with TCL Message-ID: <22938@shlump.lkg.dec.com> Date: 28 May 91 16:18:39 GMT Sender: newsdaemon@shlump.lkg.dec.com Distribution: usa Organization: Digital Equipment Corporation Lines: 30 In article <25064@well.sf.ca.us>, mjf@well.sf.ca.us (Marty Fried) asks about using the ListManger with TCL. I tried that and, eventually, gave up chasing small bugs (scrolling worked in one direction only...) It turned out to be simpler (and more flexible) to build that has, roughly, the following organization: -- ListPanorama -- this is a CSelector sub-class with three extra instance variables: aCommandBase, aDoubleClickCmd, and aBoxHeight. It creates a CScrollPane that encloses a CBorder that, in turn, encloses the CSelector. aCommandBase is passed to CSelector::ISelector. aBoxHeight is used to set the CScrollPane vertical scale. aDoubleClickCmd will be passed to the ListPanorama's supervisor by a DoDoubleClick method. The Selector also requires you to override Draw, DrawItem, HiliteItem, FindItem, and FindItemBox methods. -- ListSelector -- this is a CList subclass that has an an InstallSelector method. InstallSelector links the ListSelector to its associated ListPanorama. There is also an AdjustSelector method that is called whenever the number of items changes. I also implemented GetSelection, ChangeSelection, Append, Remove, Prepend, InsertAfter, and InsertAt methods. Linking the ListPanorama and ListSelector allows each class hierarchy to work independently, but cooperatively. Martin Minow minow@ranger.enet.dec.com