Path: utzoo!attcan!uunet!intercon!amanda@intercon.uu.net From: amanda@intercon.uu.net (Amanda Walker) Newsgroups: comp.sys.mac.programmer Subject: Re: Spleen venting (was: Re: 32-bit OS) Message-ID: <1397@intercon.UUCP> Date: 24 Aug 89 14:08:04 GMT References: <22321@andante.UUCP> <1989Aug19.221033.2241@geology.wisc.edu> <8352@hoptoad.uucp> <34184@apple.Apple.COM> <2601@iscuva.ISCS.COM> <8380@hoptoad.uucp> Sender: news@intercon.UUCP Reply-To: amanda@intercon.uu.net (Amanda Walker) Organization: InterCon Systems Corporation Lines: 37 Yow. Everybody seems to be in a bad mood about scroll bars this week :-). I think that Jim and Tim both have good points. Arbitrary limits (especially low ones) are guaranteed to be run into. Whether or not there are workarounds is beside the point. However, in the specific case of scroll bars for big views (like 60 page TIFF files), I'm not sure what the problem is. The value range of the control is only relevant when you are moving or positioning the thumb directly. a 16 bit value *doesn't lose you anything*! Now personally, I agree that using shorts for everything is really annoying (esp. in the List Manager and TextEdit), but in this particular case it's not a very hard limit. Let's take a concrete example. I have a window that provides a scrolling view on a 2550 by 198000 bit bitmap (60 pages at 300 dpi). For the moment, pretend I have enough memory in which to store it :-). Among the things I keep as part of the state of the window are the coordinates of the upper left hand corner of the currently visible area, as two 32 bit integers. I also have a scroll bar whose value can range from 0-32767. The only "special" thing I have to do when the user scrolls is to update the offsets and then set the scroll bar appropriately, rather than the other way around. If I were feeling unusually clever, I might even write a couple of small routines that used the refCon field as an extended value, so that I wouldn't even have to change my old code except to do a global replace of "SetCtlValue" and "GetCtlValue" to, say, "XSetCtlValue" and "XGetCtlValue". If I wanted to be even more general, I could make the refCon point at a handle containing 32-bit min, max, and value fields... Much less icky than making the List Manager handle >32K of data or rewriting TextEdit... -- Amanda Walker InterCon Systems Corporation amanda@intercon.uu.net | ...!uunet!intercon!amanda