🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10332

Re: Scroll bars for word-wrapped text?

#10332
From: Mike (I'll think of something ye...
Date: Mon, 21 Nov 1988 23:33
32 lines
2094 bytes
In article <13556@oberon.USC.EDU> papa@pollux.usc.edu (Marco Papa) writes:
<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]

I've been doing that. In fact, I had that working perfectly. Until I
added one last feature (which was mentioned in the original article):

<|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.

Given that I've got the window size in lines & characters, and I want
to display the "end" of the text. Assume I've got four lines to
display. One will wrap to fit perfectly on three display lines, one
fits on one line, leaving most of the display line blank, and the last
one needs two 1/2 lines bcause it breaks a _long_ word onto the next
line, leaving most of the first one blank. Now, for various window
heights (1, 2, ... 7 lines) how do I correctly determine which line to
start the display on? Now resize horizontally to make things
different, and repeat.

	<mike
--
Tell me how d'you get to be				Mike Meyer
As beautiful as that?					mwm@berkeley.edu
How did you get your mind				ucbvax!mwm
To tilt like your hat?					mwm@ucbjade.BITNET
Technical Details
Message-ID: <17332@agate.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!super!udel!gatech!uflorida!mailrus!ames!pasteur!agate!eris.berkeley.edu!mwm
References: <17286@agate.BERKELEY.EDU> <13556@oberon.USC.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!super!udel!gatech!uflorida!mailrus!ames!pasteur!agate!eris.berkeley.edu!mwm
From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Scroll bars for word-wrapped text?
Message-ID: <17332@agate.BERKELEY.EDU>
Date: 21 Nov 88 23:33:29 GMT
References: <17286@agate.BERKELEY.EDU> <13556@oberon.USC.EDU>
Sender: usenet@agate.BERKELEY.EDU
Organization: Missionaria Phonibalonica
Lines: 32