def __init__(self, parent): LightScrollableWidget.__init__(self, parent, 'Bytes', lambda p: Tk.Text(p, wrap=Tk.NONE)) if self.FONT is None: self.FONT = tkFont.Font(family=self.FONT_FAMILY, size=14, weight='normal') self.widget.tag_configure(self.FONT_TAG_NAME, font=self.FONT) self.widget.tag_configure(self.MARK_TAG_NAME, background='#d0f0d8') self.index_base = 1 self.bytes = None self.base_offset = None self.end_offset = None self.mark_ranges = None self.marked_bytes = MarkedBytes() self.clear()
def __init__(self, parent, title, columns): if self.FONT is None: self.FONT = tkFont.Font(font='TkDefaultFont') self._columns = columns self._min_column_widths = [self.FONT.measure(x) for x in self._columns] self._column_widths = self._min_column_widths[:] LightScrollableWidget.__init__(self, parent, title, lambda p: ttk.Treeview(self, columns=self._columns[1:])) self.widget.heading('#0', text=self._columns[0]) for col in self._columns[1:]: self.widget.heading(col, text=col) self.widget.tag_configure(self.LIGHT_BLUE_TAG_NAME, background=self.LIGHT_BLUE) self.widget.configure(selectmode='none') self.configured_callback = self._may_resize_columns
def set_rows(self, rows): LightScrollableWidget.set_rows(self, rows) self._column_widths = self._min_column_widths[:]