Path: utzoo!attcan!uunet!super!udel!rochester!rutgers!apple!bloom-beacon!oberon!pollux.usc.edu!papa From: papa@pollux.usc.edu (Marco Papa) Newsgroups: comp.sys.amiga.tech Subject: Re: Scroll bars for word-wrapped text? Message-ID: <13556@oberon.USC.EDU> Date: 21 Nov 88 01:18:08 GMT References: <17286@agate.BERKELEY.EDU> Sender: news@oberon.USC.EDU Reply-To: papa@pollux.usc.edu (Marco Papa) Organization: Felsina Software, Los Angeles, CA Lines: 29 In article <17286@agate.BERKELEY.EDU> mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) writes: |I've got an application that needs to put text in a window - wrapped n |word boundaries, and then allow the user to page back & forth through |the text. |Scroll bars are the obvious solution. But I don't see an easy way to |make them work "right". The problem is the word wrapping - I don't |know how many lines (or characters) will fit in the window until after |I've displayed it. Currently, I just display the text starting where I |left off, and then resize the scroll bar gadget after it's displayed. |This produces some interesting (and predictable) results. | |I know there's gotta be a way to do this so the scroll bar works |correctly. Anyone got any suggestions? Or better yet, code? Open the window with the NEWSIZE IDCMP flag and wait for NEWSIZE messages that inform you that the window has been resized. Then examine the sizes in the Window structure and together with font height and width you will be able to compute how many characters can stay in each line and how many lines you can use. [I've been using this in the capture buffer window of A-Talk III, which is GIMMEZEROZERO window. In which case you should look at Window-|GZZHeight and Width] -- Marco Papa 'Doc' P.S. Mike, you've been silent for long. Welcome back! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= uucp:...!pollux!papa BIX:papa ARPAnet:pollux!papa@oberon.usc.edu "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=