shithub: test

Download patch

ref: 7e1b3f0d74ca29443d5c28c318a45831d0e6fc46
author: glenda <glenda@9front.local>
date: Sat Jan 2 06:02:56 EST 2021

"init"

Binary files /dev/null and b/glenda.im differ
--- /dev/null	Thu Dec 31 12:39:09 2020
+++ b/mkfile	Sat Jan  2 06:02:56 2021
@@ -0,0 +1,4 @@
+</$objtype/mkfile
+TARG=test
+OFILES=test.$O
+</sys/src/cmd/mkone
--- /dev/null	Thu Dec 31 12:39:09 2020
+++ b/test.c	Sat Jan  2 06:02:56 2021
@@ -0,0 +1,37 @@
+#include <u.h>
+#include <libc.h>
+#include <draw.h>
+#include <event.h>
+
+Image *im;
+Image *bg;
+
+void
+eresized(int new)
+{
+	getwindow(display, Refmesg);
+	USED(new);
+	Point p = {100,100};
+	draw(screen, screen->r, bg, 0, ZP);
+	draw(screen, rectaddpt(screen->r, p), im, 0, ZP);
+	flushimage(display, 1);
+}
+
+void
+main()
+{
+	Event e;
+
+	initdraw(0,0,"test");
+	einit(Ekeyboard);
+
+	bg = allocimagemix(display, DRed, DWhite);
+	im = readimage(display, open("glenda.im", OREAD), 0);
+	eresized(0);
+
+	for(;;){
+		eread(Ekeyboard, &e);
+		if(e.kbdc == 'q')
+			exits(0);
+	}
+}