Tuesday, January 22, 2019

Redraw call back done

The best method to handler redraw is that the creator of the rectangle supply a redraw method, or it get the default method.  I will implement the redraw in xchars for the default window.
It starts at the upper left and draws the string t the right, until it hits the '\n', and it will increment y and reset x.

Scroller will likely screw the strings up and need its own redraw, bur for now it is all default redraw, a simple routine on a rectangle basis. PutStr keeps a line counter and accepts line by line. S in default, redraw is another of the really simples.

That problem solved. I am looking through the chain. One connection can have multiple windows, each window multiple rectangles.  Graphics contexts are on a per connection basis and can float between rectangles. Very simple model, all the code tested, in parts. this is a small re-arrange.

The default redraw is done, ll 20 lines of code. If you do not have an io manager hooked up, no problem there is a command line:

ReDraw;

Means redraw all rects, for now. Later we can do interesting stuff with callbacks on redraw. So I have manual methods everywhere,at the moment, IO is not hooked in. I can do:

Write HelloWorld; Flush; ReDraw;

All in one sequence! But it is not that way at run time, flush can easily initiate the redraw, as can IO manager. Even under different threads, xchars entry will lock.

No comments: