Hi, I have been trying to use "max-width-chars" with ellipsize on a
label that acts as a page label for a notebook with zero success. It
appears it is completely ignored as whatever I use, -1 to 200 nothing
ever changes how it looks. How it looks is either we only see a single
character with ellipses or just ellipses.
Am I missing something? is this the correct way to force a certain width
on the label?
Thx
~infirit
from gi.repository import Gtk, Pango
class MyWindow(Gtk.Window):
def __init__(self, *args, **kwargs):
super().__init__(default_width=400, default_height=300,
*args, **kwargs)
self.connect("delete-event", Gtk.main_quit)
self.notebook = Gtk.Notebook()
self.add(self.notebook)
for n in (1,2,3):
# We should see the first 20 then ellipse
label_text = "012345678901234567890"
page_label = Gtk.Label(
label_text,
max_width_chars=20,
ellipsize=Pango.EllipsizeMode.END,
halign=Gtk.Align.CENTER)
page_label.set_tooltip_text(label_text)
page_content = Gtk.Image.new_from_icon_name("go-home",
Gtk.IconSize.DIALOG)
self.notebook.insert_page(page_content, page_label, n)
window = MyWindow()
window.show_all()
Gtk.main()
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list