summaryrefslogtreecommitdiff
path: root/gui/draw/snarf.go
AgeCommit message (Collapse)Author
3 hoursgui: a widget layer, so the next program does not write oneCalvin Morrison
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 <noreply@anthropic.com>
9 hoursgui: a /dev/draw layer in go, with no cgo and no devdrawCalvin Morrison
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 <noreply@anthropic.com>