MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / __init__

Method __init__

python/examples/hellosidebar.py:37–65  ·  view source on GitHub ↗
(self, name, frame, data)

Source from the content-addressed store, hash-verified

35# provides callbacks for sidebar events, and must be created with a title.
36class HelloSidebarWidget(SidebarWidget):
37 def __init__(self, name, frame, data):
38 global instance_id
39 SidebarWidget.__init__(self, name)
40 self.actionHandler = UIActionHandler()
41 self.actionHandler.setupActionHandler(self)
42 offset_layout = QHBoxLayout()
43 offset_layout.addWidget(QLabel("Offset: "))
44 self.offset = QLabel(hex(0))
45 offset_layout.addWidget(self.offset)
46 offset_layout.setAlignment(QtCore.Qt.AlignCenter)
47 datatype_layout = QHBoxLayout()
48 datatype_layout.addWidget(QLabel("Data Type: "))
49 self.datatype = QLabel("")
50 datatype_layout.addWidget(self.datatype)
51 datatype_layout.setAlignment(QtCore.Qt.AlignCenter)
52 layout = QVBoxLayout()
53 title = QLabel(name, self)
54 title.setAlignment(QtCore.Qt.AlignCenter)
55 instance = QLabel("Instance: " + str(instance_id), self)
56 instance.setAlignment(QtCore.Qt.AlignCenter)
57 layout.addStretch()
58 layout.addWidget(title)
59 layout.addWidget(instance)
60 layout.addLayout(datatype_layout)
61 layout.addLayout(offset_layout)
62 layout.addStretch()
63 self.setLayout(layout)
64 instance_id += 1
65 self.data = data
66
67 def notifyOffsetChanged(self, offset):
68 self.offset.setText(hex(offset))

Callers 1

__init__Method · 0.45

Calls 1

UIActionHandlerClass · 0.50

Tested by

no test coverage detected