Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!ucdavis!iris!lim From: lim@iris.ucdavis.edu (Lloyd Lim) Newsgroups: comp.sys.mac.programmer Subject: Re: Maintaining scroll bars for multiple windows. Summary: a simple way Message-ID: <6544@ucdavis.ucdavis.edu> Date: 24 Jan 90 10:54:06 GMT References: <1990Jan23.190524.3693@deimos.cis.ksu.edu> Sender: uucp@ucdavis.ucdavis.edu Reply-To: lim@iris.ucdavis.edu (Lloyd Lim) Distribution: usa Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 24 In article <1990Jan23.190524.3693@deimos.cis.ksu.edu> jxf@phobos.cis.ksu.edu (Jerry Frain) writes: >I originally thought that I could traverse the list of controls that >are attached to the controlList of the WindowRecord, but I can't see >an easy way to identify which controls are scroll bars (once I do that, >I would look at the contrlRect to determine right or bottom scroll bar). Most programmers and object-oriented systems store and handle to some kind of data structure in the window's refCon. This is appropriate for complex applications. In my simpler programs I use a simpler method of identifying scrollbars. I store constants in the control refCons when they are created which let me identify horizontal and vertical scrollbars when going through the controlList. Actually, most of the time my applications are simple enough that I only have the scrollbars in the controlList and I can identify them by position in the controlList (ie - the first is the horizontal, the next is the vertical). I still need constants in the control refCons though in order to identify scrollbars in a scrollbar actionProc in a generic manner. +++ Lloyd Lim Internet: lim@iris.ucdavis.edu (128.120.57.20) Compuserve: 72647,660 US Mail: 146 Lysle Leach Hall, U.C. Davis, Davis, CA 95616