Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!chaos!STEPHENS@BINAH.CC.BRANDEIS.EDU From: stephens@BINAH.CC.BRANDEIS.EDU Newsgroups: comp.sys.mac.programmer Subject: Re: Need help with List Manager and scroll bar Message-ID: <0093B564.34842920@BINAH.CC.BRANDEIS.EDU> Date: 17 Aug 90 20:12:35 GMT References: <1573@asuvax.asu.edu>,<9781@goofy.Apple.COM> Sender: @chaos.cs.brandeis.edu Reply-To: stephens@BINAH.CC.BRANDEIS.EDU Organization: Brandeis University Lines: 35 In article <9781@goofy.Apple.COM>, stevec@Apple.COM (Steve Christensen) writes: >In article <1573@asuvax.asu.edu> system@asuvax.asu.edu (Marc Lesure) writes: >>I having a problem using the scroll bar with the List Manager. I'm unable >>to use the scroll bar at all. I can scroll within the display window by >>pulling the mouse down or pushing it up. The scroll bar is correctly >>updated when I scroll this way. But clicking the mouse within the scroll >>bar region has no effect. >> >>I have set scrollVert to TRUE in the LNew call. According to the manual >>this should implemeted all vertical scrolling functions. Is there something >>else I must do to get the scroll bar region itself functional? > >Is this list part of a dialog window? If so, you probably set it up in a >userItem. If that's the case, did you indent the right side of the rView >rectangle by 15 pixels so that the scrollbar is contained within the userItem? >Of course, if you're not using a dialog, I'm clueless since it should work >OK... > Ok, your problem is as follows: As you know, the Mac is event driven. Thus, you must have a variable defined as and EventRecord, such as myEvent. This variable is filled by calling GetNextEvent or WaitNextEvent. In order to update your list properly, as you also know, you must call LClick (spelling?) when a mousedown event occurs within the enclosing rectangle of the list. The location of the mousedown is stored in myEvent.where, but it is stored in global coordinates. Therefore, you must first convert it to local coordinates by defining a variable myPt of type Point, assigning it to myEvent.where, and then calling GlobalToLocal(&myPt). Now you merely call PtInRect(myPt,&ListRect) and if it returns TRUE, call LClick. Good Luck.