Re: How to wrap text to next line automatically when using GtkCellRendererText?



Hi.

I think the only way of dynamically wrapping text is to monitor the
text view's width, calculate the appropriate width for cell renderer
and set "wrap-width" property of cell renderer.

For monitoring the widget's dimensions you can connect handlers to
"configure-event" or "size-allocate" signals.

Bye

2009/5/20 Zhihai Wang <pageguest gmail com>:
> Dear all,
>
> I'm using GtkCellRendererText to render some text.
> This text might be very long, and I want the text wrapped to next line(s)
> according to the width of the window,
> which means I can't set "wrap-width" property of GtkCellRendererText since
> the width of the whole window might be resized by the user.
>
> I've tried for 2 days but still didn't work out:(
> Could anyone give me some clue? Sample code is preferred.
>
> Thanks in advance.
>
> I also sent to gtk-app-devel-list gnome org, if you subscribed to both,
> please kindly ignore this copy.
>
> --
> Best Regards,
>
> Zhihai Wang
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
>



-- 
Tadej Borovšak
00386 (0)40 613 131
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]