From 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 27 Jan 2022 22:43:28 -0500 Subject: Format All Files --- python/examples/hellosidebar.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python/examples/hellosidebar.py') diff --git a/python/examples/hellosidebar.py b/python/examples/hellosidebar.py index fe7cbae2..69721d4c 100644 --- a/python/examples/hellosidebar.py +++ b/python/examples/hellosidebar.py @@ -29,6 +29,7 @@ from PySide6.QtGui import QImage, QPixmap, QPainter, QFont, QColor instance_id = 0 + # Sidebar widgets must derive from SidebarWidget, not QWidget. SidebarWidget is a QWidget but # provides callbacks for sidebar events, and must be created with a title. class HelloSidebarWidget(SidebarWidget): @@ -77,6 +78,7 @@ class HelloSidebarWidget(SidebarWidget): def contextMenuEvent(self, event): self.m_contextMenuManager.show(self.m_menu, self.actionHandler) + class HelloSidebarWidgetType(SidebarWidgetType): def __init__(self): # Sidebar icons are 28x28 points. Should be at least 56x56 pixels for @@ -102,6 +104,7 @@ class HelloSidebarWidgetType(SidebarWidgetType): # widget is visible and the BinaryView becomes active. return HelloSidebarWidget("Hello", frame, data) + # Register the sidebar widget type with Binary Ninja. This will make it appear as an icon in the # sidebar and the `createWidget` method will be called when a widget is required. Sidebar.addSidebarWidgetType(HelloSidebarWidgetType()) -- cgit v1.3.1