Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uwm.edu!bionet!agate!shelby!msi.umn.edu!noc.MR.NET!gacvx2.gac.edu!gacvx2.gac.edu!scott From: scott@mephistopheles.gac.edu (Scott Hess) Newsgroups: comp.sys.next Subject: Re: NeXTstep programming question Message-ID: Date: 19 Jan 91 03:15:40 GMT References: <1048@nada.cs.utexas.edu> Organization: Gustavus Adolphus College Lines: 40 Nntp-Posting-Host: mephistopheles.gac.edu In-reply-to: garnett@cs.utexas.edu's message of 18 Jan 91 06:06:19 GMTLines: 40 In article <1048@nada.cs.utexas.edu> garnett@cs.utexas.edu (John William Garnett) writes: Here's the scenario. I have used IB to create a window with a slider object. I have been able to connect the output of the slider to a custom object. What I would like to be able to do is be able to detect each mouseDown event that corresponds to the beginning of a movement of the slider. Similarly, I wish to be able to detect the mouseUp event that signifies the end of a given slider movement. The suggestion I read earlier about how the receiver can interpret stuff like this was valid, but I still submit my version as an alternate: My thought was to subclass Slider. Then, you simply catch the starting mouseDown:, send someone that indication, then send it one to your superclass. When the superclass' mouseDown: returns, you send the indication of mouseUp to whoever needs it. To get this version working, just use a CustomView and set the class to your subclass, and away you go. That will work fine for Slider controls. It will not work for Sliders in a Matrix. Another method is to create your own SliderCell class. Override the startTrackingAt:inView: and stopTracking:at:inView: mouseIsUp: methods to send the appropriate message to whoever needs it. This will also work in a Slider Control. I'm _not_ sure how you'd go about getting this set up, though. A simple method would be to create a new SliderCell subclass and a corrosponding Slider subclass, and then combine them for a new view in a Custom InterfaceBuilder palette. This would also be decent for connecting things - you could supply another outlet to send the mouseUp and Down messages to, as opposed to the target. But, I think that my methods are a little more complex than needed. It really depends on what you need in your program . . . -- scott hess scott@gac.edu Independent NeXT Developer GAC Undergrad "Tried anarchy, once. Found it had too many constraints . . ." "Buy `Sweat 'n wit '2 Live Crew'`, a new weight loss program by Richard Simmons . . ."