Re: word wrap in liststore column



On 06/26/2010 07:25 PM, Mick wrote:
On Sat, 26 Jun 2010 02:17:11 -0400
Tristan Van Berkom<tvb gnome org>  wrote:

On Fri, Jun 25, 2010 at 8:44 PM, Mick<bareman tpg com au>  wrote:
I'm stuck again.

I wish to set word-wrap for a single column in a treeview liststore,
I've found the options I need to set but can't for the life of me
find an example of how to do it.

I think the catch is that you need to set an explicit wrap-width
when specifying wrap-mode on the GtkCellRendererText.

I know that, I have searched but not found anything that says "this is
how you set the properties of ..."

what I'm trying to do is set wrap-width to 60 characters and wrap-mode
to word somewhat like this:

GtkSomeObscureFunction(list->action, wrap-width = 60,
                        wrap-mode = PANGO_WRAP_WORD);

I think the obscure function you want is:


     gtk_container_child_set_property ()

(Not to cast aspersions at the developers but some of the function calls are truly convoluted, at least to someone not on the development team. On the other hand the documentation is superb.)
I also wish to set alternate rows backgrounds to white or pale blue,
how is this done?
I don't think there is a really clean way to do this since you can't know where the line will break. My best idea is to set the textview background (using a gdk_draw_rgb_image... () call of course. How could you not know this?). Using the row stride feature it shouldn't be too hard. See the gtk examples (sudo apt-get install gtk2.0-examples) program /usr/bin/gtk-demo and the Pixbufs example.



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