taro-ls: fix mouse rendering; taro-ctl: add some boilerplate

This commit is contained in:
Iris Lightshard 2023-03-16 00:13:05 -06:00
parent d7297b1bf8
commit 0f44a9fff7
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 21 additions and 8 deletions

View file

@ -64,7 +64,11 @@ module Taro
end end
def lifetime def lifetime
return @lifetime @lifetime
end
def msg
@msg
end end
def write_msg(msgtype : UInt8, data : Slice) def write_msg(msgtype : UInt8, data : Slice)
@ -149,10 +153,21 @@ module Taro
@lsWin.write_msg(2_u8, list.to_slice) @lsWin.write_msg(2_u8, list.to_slice)
end end
def mblaze
@mblaze
end
def mainWindow def mainWindow
@lsWin @lsWin
end end
def readWins
@readWins
end
def composeWins
@composeWins
end
end end
end end
@ -163,5 +178,7 @@ loop do
select select
when taro.mainWindow.lifetime.receive? when taro.mainWindow.lifetime.receive?
exit exit
when m = taro.mainWindow.msg.receive
# do something
end end
end end

View file

@ -98,7 +98,7 @@ JMP2r
JMP2r JMP2r
@on_mouse ( -> ) @on_mouse ( -> )
#01 .wipe_fg STZ
get_select_idx_by_mouse get_select_idx_by_mouse
.resizing LDZ #00 EQU ,&resz_check JCN .resizing LDZ #00 EQU ,&resz_check JCN
@ -120,10 +120,6 @@ JMP2r
#01 .resizing STZ #01 .resizing STZ
.Mouse/x DEI2 .resizing/x STZ2 .Mouse/x DEI2 .resizing/x STZ2
.Mouse/y DEI2 .resizing/y STZ2 .Mouse/y DEI2 .resizing/y STZ2
BRK
#01 .wipe_fg STZ
&done &done
BRK BRK
@ -154,7 +150,7 @@ BRK
,&chk_release JMP ,&chk_release JMP
&chk_release &chk_release
#01 .list/update STZ
.Screen/height DEI2 TOP_SECTION BOTTOM_SECTION ADD2 SUB2 #03 SFT2 NIP .list/height STZ .Screen/height DEI2 TOP_SECTION BOTTOM_SECTION ADD2 SUB2 #03 SFT2 NIP .list/height STZ
.Mouse/state DEI .Mouse/state DEI