def __init__(self, app): gtk.VBox.__init__(self) self.app = app self.caption_label = TabIconCaption(gtk.STOCK_INDEX, self.caption) self.data = '' spacer = gtk.VBox() self.add(spacer) self.set_border_width(5) nav_panel = gtk.HBox() nav_panel.set_border_width(0) spacer.pack_start(nav_panel, False, False) #---Panel internal content--- self.dec_box = DecoderTab(app) spacer.pack_start(self.dec_box, False, False) self.be_check = gtk.CheckButton(label=_('Big Endian values')) self.be_check.set_active(False) self.be_check.connect('clicked', self.change_be_check) spacer.pack_start(self.be_check, False, False) calc_frame = HexDecCalc() spacer.pack_start(calc_frame, False, False) #---------------------------- self.show_all() events.connect(events.BIN_SELECTION, self.get_selection)
def __init__(self, app): gtk.VBox.__init__(self) self.app = app self.logs = [] self.icon_theme = gtk.icon_theme_get_default() self.caption_label = TabIconCaption(gtk.STOCK_MISSING_IMAGE, self.caption) spacer = gtk.VBox() self.add(spacer) self.set_border_width(5) nav_panel = gtk.HBox() nav_panel.set_border_width(0) self.rec_but = NavigationButton(gtk.STOCK_MEDIA_RECORD, _('Start recording')) nav_panel.pack_start(self.rec_but, False) self.rec_but.connect('clicked', self.start_rec) self.stop_but = NavigationButton(gtk.STOCK_MEDIA_STOP, _('Stop recording')) nav_panel.pack_start(self.stop_but, False) self.stop_but.connect('clicked', self.stop_rec) separator = gtk.VSeparator() nav_panel.pack_start(separator, False) self.clear_but = NavigationButton(gtk.STOCK_CLEAR, _('Clear logs')) nav_panel.pack_start(self.clear_but, False) self.clear_but.connect('clicked', self.clear_logs) spacer.pack_start(nav_panel, False) self.treeview = gtk.TreeView() self.scrolledwindow = gtk.ScrolledWindow() self.scrolledwindow.add(self.treeview) self.scrolledwindow.set_shadow_type(gtk.SHADOW_ETCHED_IN) self.scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) spacer.pack_end(self.scrolledwindow, True) #-------TreeList-------------- col = gtk.TreeViewColumn() col.set_title(_('Log Entries')) render_pixbuf = gtk.CellRendererPixbuf() col.pack_start(render_pixbuf, expand=False) col.add_attribute(render_pixbuf, 'pixbuf', 0) render_text = gtk.CellRendererText() col.pack_start(render_text, expand=True) col.add_attribute(render_text, 'text', 1) self.treeview.append_column(col) #----------------------------- self.treeview.set_rules_hint(True) self.show_all() self.update_view()
def __init__(self, app): gtk.VBox.__init__(self) self.app = app self.caption_label = TabIconCaption(gtk.STOCK_PASTE, self.caption) spacer = gtk.VBox() self.add(spacer) self.set_border_width(5) nav_panel = gtk.HBox() nav_panel.set_border_width(0) self.show_all()
def __init__(self, app, root=''): gtk.VBox.__init__(self, False, 0) self.mw = app.mw self.app = app self.caption_label = TabIconCaption(gtk.STOCK_MEDIA_PLAY, self.caption) self.root = root self.current_dir = "" + config.scr_current_directory spacer = gtk.VBox() self.add(spacer) self.set_border_width(5) label = gtk.Label(self.caption.upper()) spacer.pack_start(label, False) separator = gtk.HSeparator() spacer.pack_start(separator, False) nav_panel = gtk.HBox() nav_panel.set_border_width(3) self.back_but = NavigationButton(gtk.STOCK_GO_BACK, _('Go Back')) nav_panel.pack_start(self.back_but, False) self.back_but.connect('clicked', self.action_back) self.up_but = NavigationButton(gtk.STOCK_GO_UP, _('Go Up')) nav_panel.pack_start(self.up_but, False) self.up_but.connect('clicked', self.action_up) self.forward_but = NavigationButton(gtk.STOCK_GO_FORWARD, _('Go Forward')) nav_panel.pack_start(self.forward_but, False) self.forward_but.connect('clicked', self.action_forward) self.home_but = NavigationButton(gtk.STOCK_HOME, _('Home directory')) nav_panel.pack_start(self.home_but, False) self.home_but.connect('clicked', self.action_home) separator = gtk.VSeparator() nav_panel.pack_start(separator, False, padding=2) self.refr_but = NavigationButton(gtk.STOCK_REFRESH, _('Refresh')) nav_panel.pack_start(self.refr_but, False) self.refr_but.connect('clicked', self.update_view) separator = gtk.VSeparator() nav_panel.pack_start(separator, False, padding=2) self.find_but = NavigationToggleButton(gtk.STOCK_FIND, _('Show all files')) nav_panel.pack_start(self.find_but, False) self.find_but.connect('clicked', self.update_view) spacer.pack_start(nav_panel, False) self.listmodel = FileListModel() self.treeview = gtk.TreeView() self.column = gtk.TreeViewColumn() self.column.set_title(_('Log Entries')) render_pixbuf = gtk.CellRendererPixbuf() self.column.pack_start(render_pixbuf, expand=False) self.column.add_attribute(render_pixbuf, 'pixbuf', 0) render_text = gtk.CellRendererText() self.column.pack_start(render_text, expand=True) self.column.add_attribute(render_text, 'text', 1) self.treeview.append_column(self.column) self.treeview.connect('row-activated', self.open_file) self.scrolledwindow = gtk.ScrolledWindow() self.scrolledwindow.add(self.treeview) self.scrolledwindow.set_shadow_type(gtk.SHADOW_ETCHED_IN) self.scrolledwindow.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) spacer.pack_end(self.scrolledwindow, True) self.treeview.set_model(self.listmodel) self.treeview.set_rules_hint(True) events.connect(events.CONFIG_MODIFIED, self.update_by_config) self.find_but.set_active(config.scr_show_all_files) self.update_view()