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?
self.notebook = Gtk.Notebook()
for n in (1,2,3):
# We should see the first 20 then ellipse
label_text = "012345678901234567890"
page_label = Gtk.Label(
page_content = Gtk.Image.new_from_icon_name("go-home",
self.notebook.insert_page(page_content, page_label, n)
> Give the hexpand a try and see if that works. It works for me on Python3.5 and GTK3.18
Define works :) Does it limit to what was set as maximum width chars?
When resizing does it use the available space to show more or less
characters? Nope :(
It indeed does expand the label but it expands to the complete width of
the notebook (ugly). While this appears to have the effect to fix the
problem is really doesn't as max-width-chars is still not properly used.
Its behaviour is very inconsistent imo and appears very broken.
Re: GtkLabel max-width-chars with ellipsize broken?
What version of GTK are you using?
It does work on my computer. The label expands and shrinks as the window expands and shrinks and the label stops expanding at 012345678901234567... I take that to be 20 chars if you start at 0 and include the three dots. The tooltip shows the full string.