<feed xmlns='http://www.w3.org/2005/Atom'>
<title>9line.git/gui/draw, branch master</title>
<subtitle>random plan9 experiements
</subtitle>
<id>https://git.ceux.org/9line.git/atom?h=master</id>
<link rel='self' href='https://git.ceux.org/9line.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.ceux.org/9line.git/'/>
<updated>2026-08-22T23:12:01+00:00</updated>
<entry>
<title>gui: a widget layer, so the next program does not write one</title>
<updated>2026-08-22T23:12:01+00:00</updated>
<author>
<name>Calvin Morrison</name>
<email>calvin@pobox.com</email>
</author>
<published>2026-08-22T23:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ceux.org/9line.git/commit/?id=77c7bc9b187450818ec068239a3ae836d01fdebc'/>
<id>urn:sha1:77c7bc9b187450818ec068239a3ae836d01fdebc</id>
<content type='text'>
cal9 had grown its own: borders drawn four fills at a time in two
places, a button-3 menu, hit regions, buttons, text wrapping. None of
that is about calendars, and a second program would have written it
again, differently. It lives in gui/ui now.

It is a kit and not a framework. Every call draws a thing and, where it
makes sense, records where it drew it; the program keeps its own event
loop and its own idea of what to redraw. Menu takes a redraw function
rather than calling back into anything. The moment the library owns the
loop it stops being usable by the next program, which was the problem
being fixed.

Body is the fix for two bugs that turned out to be one. rio draws a
window's border into the client's own image and puts corner cursors in
it, taking those clicks before the client sees them: the border is
rio's resize handle. Filling the whole rectangle erased it, so the
border vanished and so did resizing. Drawing inside Body gives both
back, and the drag-to-resize cal9 had grown -- which could only ever
shrink, since a window stops getting mouse events once the pointer
leaves it -- was deleted rather than fixed.

Field is one line of editable text with a cursor, backspace, ^U and a
paste from /dev/snarf. No selection, no mouse placement, no history: a
form asking for a summary and a time needs none of them and each is
somewhere to be subtly wrong.

Co-Authored-By: Claude Opus 5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>gui: a /dev/draw layer in go, with no cgo and no devdraw</title>
<updated>2026-08-22T17:16:35+00:00</updated>
<author>
<name>Calvin Morrison</name>
<email>calvin@pobox.com</email>
</author>
<published>2026-08-22T17:16:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ceux.org/9line.git/commit/?id=9aacce8b3b54060d0037eca897856d7273e6e5e8'/>
<id>urn:sha1:9aacce8b3b54060d0037eca897856d7273e6e5e8</id>
<content type='text'>
9fans.net/go/draw builds for plan9 but shells out to plan9port's
devdraw, which 9front does not have. This talks to /dev/draw itself:
the protocol is file i/o, so a pure-go client is a few hundred lines
under an already-complete idea.

draw/keyboard.go opens /dev/cons and turns the console raw, as
libdraw's initkeyboard does. Without it rio keeps its line editor on
the window and paints what you type over the drawing.

draw/snarf.go writes /dev/snarf, which is what every other program on
the system means by copy.

Co-Authored-By: Claude Opus 5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
