From 73a9399f5d1d86c7e291498b7fe836550f2f76ab Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 2 Apr 2019 15:30:45 -0400 Subject: Add a C++ version of the triage plugin (no Makefile yet) --- python/examples/triage/byte.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'python/examples/triage/byte.py') diff --git a/python/examples/triage/byte.py b/python/examples/triage/byte.py index 4caf228f..fe887fb4 100644 --- a/python/examples/triage/byte.py +++ b/python/examples/triage/byte.py @@ -207,8 +207,7 @@ class ByteView(QAbstractScrollArea, View): areaSize = self.viewport().size() self.adjustSize(areaSize.width(), areaSize.height()) - def createRenderContext(self): - render = RenderContext(self) + def getFont(self): userFont = binaryninjaui.getMonospaceFont(self) if sys.platform == "darwin": # Some fonts aren't fixed width across all characters, use a known good one @@ -216,7 +215,11 @@ class ByteView(QAbstractScrollArea, View): font.setKerning(False) else: font = userFont - render.setFont(font) + return font + + def createRenderContext(self): + render = RenderContext(self) + render.setFont(self.getFont()) return render def adjustSize(self, width, height): @@ -314,6 +317,7 @@ class ByteView(QAbstractScrollArea, View): self.lines.insert(0, line) self.topLine += 1 self.topAddr = prevEnd + return True def cacheNextLines(self): lastAddr = self.data.start -- cgit v1.3.1