def generate_label(self, text): """Generate a simple label.""" label = Label(text) label.set_use_markup(True) label.set_halign(Gtk.Align.START) label.set_valign(Gtk.Align.CENTER) self.wrapper.pack_start(label, True, True, 0)
def on_query_tooltip(_widget, x, y, keybmode, tooltip, text): # pylint: disable=unused-argument """Prepare a custom tooltip with a fixed width""" label = Label(text) label.set_use_markup(True) label.set_max_width_chars(60) hbox = Gtk.Box() hbox.pack_start(label, False, False, 0) hbox.show_all() tooltip.set_custom(hbox) return True
def on_query_tooltip(widget, x, y, keybmode, tooltip, text): """Prepare a custom tooltip with a fixed width""" label = Label(text) label.set_use_markup(True) label.set_max_width_chars(60) hbox = Gtk.Box() hbox.pack_start(label, False, False, 0) hbox.show_all() tooltip.set_custom(hbox) return True