def create_tab(self, title, tab_child, icon=''):
tab_box = Gtk.HBox(False, 3)
close_button = Gtk.Button()
image = Gtk.Image()
image.set_from_stock(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU)
label = Gtk.Label(label=title)
if icon:
i = Gtk.Image()
i.set_from_stock(eval('Gtk.STOCK_' + icon), Gtk.IconSize.MENU)
tab_box.pack_start(i, False, False, 0)
close_button.connect("clicked", self.close_tab, tab_child)
close_button.set_image(image)
close_button.set_relief(Gtk.ReliefStyle.NONE)
tab_box.pack_start(label, True, True, 0)
tab_box.pack_end(close_button, False, False, 0)
tab_box.show_all()
if title in ['Loading dasm...', 'Code', 'Callgraph', 'Flowgraph', 'Interactive', 'Strings', "Sections", 'Hexdump', 'Bindiff', 'File info']:
close_button.hide()
return tab_box
评论列表
文章目录