Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!hub!6500stom From: 6500stom@hub.UUCP (David Stoms) Newsgroups: comp.sys.mac.programmer Subject: Re: Maintaining scroll bars for multiple windows. Message-ID: <3714@hub.UUCP> Date: 24 Jan 90 00:29:28 GMT Sender: news@hub.UUCP Lines: 31 From article <1990Jan23.190524.3693@deimos.cis.ksu.edu>, by jxf@phobos.cis.ksu.edu (Jerry Frain): > 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). The slick way to do this is to allocate a handle in refCon of the WindowRecord. You can then store the handles to the scroll bars there. This is real easy is C and a little less easy in Pascal. Example: typedef struct { int windowID; /* maybe, maybe not */ ContorlHandle hScrollBar; ControlHandle vScrollBar; } MyWindowInfoRec, **MyWindowInfoHdl; Then: MyWindow->refCon = (long)MyWindowInfoHdl; > Does the ControlHandle tell which ControlDefProc ID I specified at > creation? Yes and no but mostly yes: the ControlDefProc field is a handle to the CDEF. You can do a GetResInfo on it if you have the urge to. / Josh Pritikin T The C++ programming language \ | Internet: 6500stom@ucsbuxa.ucsb.edu | is at worst, the second best | | AppleLink: Josh.P | for a given application. | \ GEnie: J.Pritikin ! But usually, it is the best. /