From bbacbc7af4d62cdcfd5ce8f1f51ce512337570c1 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 26 Apr 2023 10:27:36 -0700 Subject: [PATCH] (notepad) Added closing behaviors --- gui/notepad/notepad.tal | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gui/notepad/notepad.tal b/gui/notepad/notepad.tal index 91a1227..1f31c44 100644 --- a/gui/notepad/notepad.tal +++ b/gui/notepad/notepad.tal @@ -38,11 +38,16 @@ BRK trap-mouse - .Mouse/state DEI ?&on-mouse-down - -BRK - -&on-mouse-down ( -> ) + [ LIT &last $1 ] + .Mouse/state DEI + DUP ,&last STR + EQU ?&unchanged + draw-header + ( release on close button ) + .Mouse/state DEI #00 NEQ ?&unchanged + .Mouse/x DEI2 #0008 SUB2 #000a GTH2 ?&unchanged + #010f DEO + &unchanged BRK @@ -153,7 +158,9 @@ JMP2r ;bar-icn/a .Screen/addr DEO2 #01 .Screen/sprite DEO ( close ) - ;close-icn/default .Screen/addr DEO2 + ;close-icn/default + #00 .Mouse/state DEI #00 NEQ .Mouse/x DEI2 #0008 SUB2 #000a LTH2 AND + #50 SFT2 ADD2 .Screen/addr DEO2 #01 .Screen/sprite DEOk DEO ( lead ) #e9 &l