TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Rider
from: Christopher Turcksin
date: 1995-05-14 13:58:50
subject: BackGround windows...

Paul Rider wrote in a message to All:

 PR> the only way I can think of doing that is to have a chunk of
 PR> memory the size of the window, update it all at every window
 PR> write request, and then when writting to the actual screen
 PR> I'll have to check every other window shown to see if it
 PR> overlaps it... Please tell me there's a better way. Or if

I never wrote programs using a TUI (never needed to, all my stuff needs to
run unattended) but I did look into window-stuff (both text and gfx) and
event-driven programming.

You have to check for each byte written to the screen, if that position
isn't overlapped by another window. Simple algorithms check the X,Y
coordinates for each against the boundaries of every other window, which
makes it very slow, especially if the window is at the bottom of the stack.

The solution to this is to make the 'checks' only once and 'remember' the
result. Iow, you have to build a matrix with the same dimensions of the
screen. In each position, you store the handle of the window that is
visible in that position. This matrix is rebuilt each time the Z-order of
the Windows changes. When you update the contents of a Window, you just
check the corresponding handle in the matrix for each position you're
writing to see if the handle is yours. If not, your Window is overlapped
there by another, so you don't write!

TTFN & DKAW

The Cwazy Wabbit 
--- 
* Origin: Wabbit++ ... Wabbit with Class (2:292/608)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 292/608 600 505 850 293/2602 270/101 105/103 42 712/515 711/808 809
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.