From 24f64a3708904660fb9c07b3c9ea31734e0f8088 Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 26 May 2023 11:29:54 -0400 Subject: "*" --- p9c/scratch/mouse | Bin 0 -> 191138 bytes p9c/scratch/mouse.c | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 p9c/scratch/mouse (limited to 'p9c') diff --git a/p9c/scratch/mouse b/p9c/scratch/mouse new file mode 100755 index 0000000..43d836a Binary files /dev/null and b/p9c/scratch/mouse differ diff --git a/p9c/scratch/mouse.c b/p9c/scratch/mouse.c index 214526a..80bfb00 100644 --- a/p9c/scratch/mouse.c +++ b/p9c/scratch/mouse.c @@ -3,6 +3,10 @@ #include #include +char* options[] = {"Right Click", "", "Option3", "Option4", "Exit", 0}; + +Menu rightmenu = {options}; + void eresized(int new) { @@ -13,19 +17,27 @@ eresized(int new) void main(int argc, char* argv[]) { - // USED(argc, argv); Mouse m; + Event ev; + int e; Point prevm; + initdraw(0, 0, "Example: Mouse"); eresized(0); einit(Emouse); /* Main loop */ for(;;) { + e = event(&ev); m = emouse(); - if(m.buttons & 4) - break; + if((e == Emouse) && (m.buttons & 4)) + if(emenuhit(3, &ev.mouse, &rightmenu) == 2) + print("Pressed Option 3\n"); + if(emenuhit(3, &ev.mouse, &rightmenu) == 3) + print("Pressed Option 4\n"); + if(emenuhit(3, &ev.mouse, &rightmenu) == 4) + exits(nil); if(m.buttons & 1) { line(screen, prevm.x == -1 ? m.xy : prevm, -- cgit 1.4.1-2-gfad0 From aa58d6b5f41f2b84c9d06d1f13e9b35039600712 Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 26 May 2023 11:32:34 -0400 Subject: "*" --- p9c/scratch/mouse | Bin 191138 -> 0 bytes p9c/scratch/mouse.c | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100755 p9c/scratch/mouse (limited to 'p9c') diff --git a/p9c/scratch/mouse b/p9c/scratch/mouse deleted file mode 100755 index 43d836a..0000000 Binary files a/p9c/scratch/mouse and /dev/null differ diff --git a/p9c/scratch/mouse.c b/p9c/scratch/mouse.c index 80bfb00..6e18e3c 100644 --- a/p9c/scratch/mouse.c +++ b/p9c/scratch/mouse.c @@ -23,7 +23,7 @@ main(int argc, char* argv[]) int e; Point prevm; - initdraw(0, 0, "Example: Mouse"); + initdraw(0, 0, "draw"); eresized(0); einit(Emouse); -- cgit 1.4.1-2-gfad0 From e1eb2a339caf6509d12195deb8a2911f2cc57386 Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 26 May 2023 11:34:07 -0400 Subject: "*" --- p9c/scratch/mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p9c') diff --git a/p9c/scratch/mouse.c b/p9c/scratch/mouse.c index 6e18e3c..21c6d33 100644 --- a/p9c/scratch/mouse.c +++ b/p9c/scratch/mouse.c @@ -41,7 +41,7 @@ main(int argc, char* argv[]) if(m.buttons & 1) { line(screen, prevm.x == -1 ? m.xy : prevm, - m.xy, Enddisc, Enddisc, 1, display->black, ZP); + m.xy, Enddisc, Enddisc, 1, display->black, ZP); // where the int after Enddisc with the width of the line drawn prevm = m.xy; } else { prevm = Pt(-1, -1); -- cgit 1.4.1-2-gfad0 From 20db18aa28fbe6b548ba1d654204276f132b2427 Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 26 May 2023 11:48:12 -0400 Subject: * --- coffee/starfish.coffee | 5 +++-- p9c/notes.md | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'p9c') diff --git a/coffee/starfish.coffee b/coffee/starfish.coffee index bfd5f44..7f63720 100644 --- a/coffee/starfish.coffee +++ b/coffee/starfish.coffee @@ -1,4 +1,5 @@ square = (x) -> x * x -cube = (x) -> square(x) * x +cube = (x) -> square x * x + +console.log cube 33 -console.log cube(33) diff --git a/p9c/notes.md b/p9c/notes.md index aef41f6..b3c6d00 100644 --- a/p9c/notes.md +++ b/p9c/notes.md @@ -6,6 +6,7 @@ http://doc.cat-v.org/plan_9/programming/c_programming_in_plan_9 http://blog.postnix.pw/2018/09/21/0/ http://sdf.org/?tutorials/Plan_9_C https://9fans.github.io/plan9port/man/man3/intro.html +https://github.com/nspool/hello-plan9 general: -- cgit 1.4.1-2-gfad0 From 122ea6e7046520da4aeb8e5e787a9d3214b5ec46 Mon Sep 17 00:00:00 2001 From: eli-oat Date: Fri, 26 May 2023 12:01:34 -0400 Subject: * --- p9c/hello-plan9/ball.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p9c') diff --git a/p9c/hello-plan9/ball.c b/p9c/hello-plan9/ball.c index 281beb0..22566ef 100755 --- a/p9c/hello-plan9/ball.c +++ b/p9c/hello-plan9/ball.c @@ -89,7 +89,7 @@ initball() void main(int argc, char *argv[]) { - USED(argc, argv); + // USED(argc, argv); Event ev; int e, timer; -- cgit 1.4.1-2-gfad0