mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-15 11:20:03 +00:00
44 lines
573 B
C
44 lines
573 B
C
#include <u.h>
|
|
#include <libc.h>
|
|
#include <draw.h>
|
|
#include <event.h>
|
|
|
|
void
|
|
eresized(int new)
|
|
{
|
|
if(new && getwindow(display, Refnone) < 0){
|
|
fprint(2, "colors: can't reattach to window: %r\n");
|
|
exits("resized");
|
|
}
|
|
draw(screen, screen->r, display->white, nil, ZP);
|
|
flushimage(display, 1);
|
|
}
|
|
|
|
char *buttons[] =
|
|
{
|
|
"exit",
|
|
0
|
|
};
|
|
|
|
Menu menu =
|
|
{
|
|
buttons
|
|
};
|
|
|
|
void
|
|
main(int argc, char *argv[])
|
|
{
|
|
Mouse m;
|
|
|
|
initdraw(0,0,0);
|
|
eresized(0);
|
|
einit(Emouse);
|
|
for(;;){
|
|
m = emouse();
|
|
if(m.buttons == 4)
|
|
switch(emenuhit(3, &m, &menu)){
|
|
case 0:
|
|
exits(0);
|
|
}
|
|
}
|
|
}
|