Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!pictel!harling From: harling@pictel.uucp (Dan Harling) Newsgroups: comp.windows.open-look Subject: Re: Help modifying textsw scrollbar Message-ID: <1991Jun24.170403.1381@pictel.uucp> Date: 24 Jun 91 17:04:03 GMT Article-I.D.: pictel.1991Jun24.170403.1381 References: <1991Jun20.210038.5036@pictel.uucp> Sender: Dan Harling Organization: PictureTel Corporation Lines: 63 In article jcb@NCD.COM (Jim Becker) writes: >harling@pictel.uucp (Dan Harling) writes: > I know that my proportioning code is correct, because the horizontal > scrollbar moves as expected. I suspect that the text window still has > a handle to the vertical scrollbar, and is reproportioning it > automatically, but I have been unable to eliminate this. If I destroy > the original scrollbar and try to create a new one, no vertical > scrollbar appears at all. > >the vertical scrollbar is _owned_ by the TEXTSW object, and you >shouldn't be trying to set it. you can't subvert it, as it knows how >many lines are in the TEXTSW content and sets the scrollbar to reflect >this. it's not under your domain to change. I realize that the TEXTSW vertical scrollbar is not intended to be changed. However, in order to have the scrollbar do something other than the default functions, I must either redefine some of its characteristics, or replace it with another scrollbar. Redefining the scrollbar has been quite successful: it does everything it is supposed to do (determine the new origin and redraw the display) except move the elevator. Similar code for the horizontal scrollbar, which I created separately, works properly. Replacing it with a new one has failed miserably; either no scrollbar appears, or the default one covers over the new one, making it inaccessible. I am quite familiar with the obstacles involved in what I am attempting. The XView manual even bails out when it comes to doing anything custom with scrollbars. It should not be this difficult, but the documentation is sadly lacking. In short, I have already heard all the reasons why I *shouldn't* do this; so far, nobody has shown me that it *can't* be done (e.g., that the code which automatically sets the scrollbar properties according to the window contents, overriding my values, cannot be overridden). >sounds like you want to use a CANVAS, and do your own attached >scrollbars to it. Unfortunately, there are three reasons I decided not to use the CANVAS package, if I can avoid it: 1) The display routines already exist in another module, and are written for text windows. I would either have to duplicate the code for canvas (maintenance nightmare), or rewrite the other module to use a one-scrollbar canvas instead of a text window! 2) There could be a large number of these active at one time. The text-based display function is barely fast enough as it is; any further slowdown would be unacceptable. 3) It just doesn't make sense to have to use what is essentially a graphical medium to display pure text. If this is indeed necessary, then I would contend that there is a design problem here: an internal (inaccessible) dependence between packages. >-Jim ______________________________________________________________________ Daniel A. Harling uunet!pictel!harling PictureTel, Inc. Rockport, MA Peabody, MA Opinions expressed herein are not necessarily those of PictureTel, Inc.; they are MINE, ALL MINE! (So there.) ---- === ====