Try setting "width-chars" property as well as "max-width-chars" property.

GtkLabel apis could use a face-lift. It's possible that the default minimum
width request exceeds the 10 max-width-chars which you set (which is
what I assume is causing this problem).

Cheers,
          -Tristan

On Fri, Dec 9, 2011 at 1:39 AM, David Gomes <davidrafago...@gmail.com> wrote:
> Hello there,
>
> I was wondering if there was a way of avoiding a label (in a notebook)
> to resize the window when the text in it is too big.
>
> I heard of ellipsizing, and EllipsizeMode.END seems great for me, but
> if I ellipsize it, it will be ellipsized even if the label is small.
>
> So, I want to ellipsize it only when it becomes too big (over X
> pixels), but I only seem to be able to limit it's width in chars using
> max_width_chars. I also tried setting my label's max_width_chars to
> 10, but the string could still increase a lot, so it didn't work.
>
> What do you recommend? Ideally, I would like to have a maximum width
> in pixels, but chars is ok too.
>
> /* Relevant code (vala) */
> tab.label.max_width_chars = 10;
>
> --
> David Gomes
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to