Re: Background color of Treeviews with just few rows

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

 



This code works for me for GTK 2.x:

static const char color_rc[] =
                "style \"aaa\"\n"
                "{\n"
                "GtkTreeView::odd-row-color=\"#%04x%04x%04x\"\n"
                "GtkTreeView::even-row-color =\"#%04x%04x%04x\"\n"
                "}\n"
                "widget \"*.aaa\" style \"aaa\"";  // removed "class \"GtkTreeView\"" because it would change all trees

            gchar *rc_temp = g_strdup_printf(color_rc,
                color.red,
                color.green,
                color.blue,
                color.red,
                color.green,
                color.blue);
            gtk_rc_parse_string(rc_temp);
            gtk_widget_set_name(widget, "aaa");
            gtk_widget_reset_rc_styles(widget);
            g_free(rc_temp);

I hope it helps.

Regards,
  Miroslav
On 30.9.2015. 8:51, Juan L. Freniche wrote:
Hello, I would appreciate help in this topic:

I have a notebook with several pages. Every page has a scrolledwindow and then a treeview.

For treeviews with sufficient rows, no problema but if the treeview has a small number of rows, the remaining area below the last row is in white color.

I would like to change the color of this area. I tried

style =get_style (widget)
set_background (style, state_normal, other color)
set_style (widget, style)


where widget was sucessively the notebook, the scrolled window and the treeview. No success.

I am using Gtk 2.24 and in the process of moving to Gtk3.

Thanks in advance.

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux