from gi.repository import Gtk from pychrysalide.features import * DEFAULT_MSG = 'No active loaded binary' class HelloPanel(PanelItem): def __init__(self): """Initialize the GUI panel.""" self._label = Gtk.Label() self._label.set_text(DEFAULT_MSG) params = { 'name' : 'Hello', 'widget' : self._label, 'personality' : PanelItem.PIP_SINGLETON, 'lname' : 'Hello panel description', 'dock' : True, 'path' : 'MEN' } super(HelloPanel, self).__init__(**params) def _change_content(self, old, new): """Get notified about loaded content change.""" if type(new) is LoadedBinary: count = len(list(new.processor.instrs)) self._label.set_text('Loaded binary with %u instructions' % count) else: self._label.set_text(DEFAULT_MSG)