1 ##===-- statuswin.py -----------------------------------------*- Python -*-===##
3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # See https://llvm.org/LICENSE.txt for license information.
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 ##===----------------------------------------------------------------------===##
15 class StatusWin(cui
.TextWin
):
16 def __init__(self
, x
, y
, w
, h
):
17 super(StatusWin
, self
).__init
__(x
, y
, w
)
19 self
.keys
= [ # ('F1', 'Help', curses.KEY_F1),
20 ("F3", "Cycle-focus", curses
.KEY_F3
),
21 ("F10", "Quit", curses
.KEY_F10
),
25 self
.win
.addstr(0, 0, "")
27 self
.win
.addstr("{0}".format(key
[0]), curses
.A_REVERSE
)
28 self
.win
.addstr(" {0} ".format(key
[1]), curses
.A_NORMAL
)
29 super(StatusWin
, self
).draw()
31 def handleEvent(self
, event
):
32 if isinstance(event
, int):
34 elif isinstance(event
, lldb
.SBEvent
):
35 if lldb
.SBProcess
.EventIsProcessEvent(event
):
36 state
= lldb
.SBProcess
.GetStateFromEvent(event
)
37 status
= lldbutil
.state_type_to_str(state
)
39 x
= self
.win
.getmaxyx()[1] - len(status
) - 1
40 self
.win
.addstr(0, x
, status
)