bindiff.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:bokken 作者: thestr4ng3r 项目源码 文件源码
def __init__(self):
        GObject.GObject.__init__(self)
        self.set_position (500)
        # Graph viewers
        hbox = Gtk.HBox(True, 5)
        dw = self.dw = DiffView()
        dw2 = self.dw2 = DiffView()
        hbox.pack_start(dw, True, True, 0)
        hbox.pack_start(dw2, True, True, 0)
        self.add(hbox)
        # Function list
        scrolledwin = Gtk.ScrolledWindow()
        scrolledwin.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        liststore = self.liststore = Gtk.ListStore(str, str, str, str, str)
        treeview = Gtk.TreeView(liststore)
        # Column Address L
        tvcolumn0 = Gtk.TreeViewColumn('Function L')
        treeview.append_column(tvcolumn0)
        cell0 = Gtk.CellRendererText()
        tvcolumn0.pack_start(cell0, True)
        tvcolumn0.add_attribute(cell0, 'text', 0)
        tvcolumn0.set_sort_column_id(0)
        # Column Function L
        tvcolumn1 = Gtk.TreeViewColumn('Address L')
        treeview.append_column(tvcolumn1)
        cell1 = Gtk.CellRendererText()
        tvcolumn1.pack_start(cell1, True)
        tvcolumn1.add_attribute(cell1, 'text', 1)
        tvcolumn1.set_sort_column_id(1)
        # Column Address R
        tvcolumn2 = Gtk.TreeViewColumn('Function R')
        treeview.append_column(tvcolumn2)
        cell2 = Gtk.CellRendererText()
        tvcolumn2.pack_start(cell2, True)
        tvcolumn2.add_attribute(cell2, 'text', 2)
        tvcolumn2.set_sort_column_id(2)
        # Column Function R
        tvcolumn3 = Gtk.TreeViewColumn('Address R')
        treeview.append_column(tvcolumn3)
        cell3 = Gtk.CellRendererText()
        tvcolumn3.pack_start(cell3, True)
        tvcolumn3.add_attribute(cell3, 'text', 3)
        tvcolumn3.set_sort_column_id(3)
        # Column Diff
        tvcolumn4 = Gtk.TreeViewColumn('Diff')
        treeview.append_column(tvcolumn4)
        cell4 = Gtk.CellRendererText()
        tvcolumn4.pack_start(cell4, True)
        tvcolumn4.add_attribute(cell4, 'text', 4)
        tvcolumn4.set_sort_column_id(4)
        # Set treeview options and add it to scrolledwin
        treeview.set_reorderable(True)
        scrolledwin.add(treeview)
        self.add2(scrolledwin)
        treeview.connect('row-activated', self.on_row_activated)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号