def draw(self): super(SimpleTitlebar, self).draw() if not self.title: self.title = self.client.title width = self.geometry.width - 2 * self.margin title = self.config.font_info.truncate(unicode(self.title), width) text_items = list(textitem16(title)) self.conn.core.PolyText16(self.window, self.config.fg_gc, self.margin, self.config.baseline, len(text_items), "".join(text_items))
def draw_string(x, string): text_items = list(textitem16(string)) self.conn.core.PolyText16(self.window, self.config.fg_gc, x, y, len(text_items), "".join(text_items)) return f.text_width(string)