Change GtkTreeViewColumn header background color
- From: Gabriele Greco <gabriele greco darts it>
- To: gtk-app-devel-list gnome org
- Subject: Change GtkTreeViewColumn header background color
- Date: Mon, 18 Dec 2006 15:12:01 +0100
There is an easy way to do it, a rc option would be very nice but I've
not found it!
Adding a custom object as column header is not ok, since you get your
background only under the label (the border and the arrow keep the old
background).
Lurking in the sources I've found this way, but it's way too
implementation dependant:
GtkWidget *l = gtk_label_new(title.c_str());
gtk_widget_show(l);
gtk_tree_view_column_set_widget(col, l);
GtkWidget *w = gtk_tree_view_column_get_widget(col);
// From the sources this is the object hiearchy:
// get_widget object -> alignment -> hbox -> button
GtkWidget *b = w->parent->parent->parent;
GdkColor bg;
gdk_color_parse("#b8b8b8", &bg);
gtk_widget_modify_bg(b, GTK_STATE_NORMAL, &bg);
--
Bye,
Gabry
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]