Daniel Malea | e33c4ba | 2013-10-11 17:13:07 +0000 | [diff] [blame] | 1 | ##===-- eventwin.py ------------------------------------------*- Python -*-===## |
| 2 | ## |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 3 | # The LLVM Compiler Infrastructure |
Daniel Malea | e33c4ba | 2013-10-11 17:13:07 +0000 | [diff] [blame] | 4 | ## |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
Daniel Malea | e33c4ba | 2013-10-11 17:13:07 +0000 | [diff] [blame] | 7 | ## |
| 8 | ##===----------------------------------------------------------------------===## |
| 9 | |
Daniel Malea | 4c3261d | 2013-10-09 22:11:30 +0000 | [diff] [blame] | 10 | import cui |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 11 | import lldb |
| 12 | import lldbutil |
| 13 | |
Daniel Malea | 4c3261d | 2013-10-09 22:11:30 +0000 | [diff] [blame] | 14 | |
| 15 | class EventWin(cui.TitledWin): |
Daniel Malea | 4c3261d | 2013-10-09 22:11:30 +0000 | [diff] [blame] | 16 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 17 | def __init__(self, x, y, w, h): |
| 18 | super(EventWin, self).__init__(x, y, w, h, 'LLDB Event Log') |
| 19 | self.win.scrollok(1) |
| 20 | super(EventWin, self).draw() |
Daniel Malea | 4c3261d | 2013-10-09 22:11:30 +0000 | [diff] [blame] | 21 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 22 | def handleEvent(self, event): |
| 23 | if isinstance(event, lldb.SBEvent): |
| 24 | self.win.scroll() |
| 25 | h = self.win.getmaxyx()[0] |
| 26 | self.win.addstr(h - 1, 0, lldbutil.get_description(event)) |
| 27 | return |