Re: Different Background-Color for even/odd Rows in TreeView



> --- Ursprüngliche Nachricht ---
> Von: Jason Burchfield <jason burchfield cas-inc com>
> An: thomschu <thom_schu gmx de>
> Kopie: gtkmm-list gnome org
> Betreff: Re: Different Background-Color for even/odd Rows in TreeView
> Datum: Wed, 08 Mar 2006 08:25:05 -0600
> 
> thomschu wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi ,
> > how can I change the background-color for a TreeView, so that even and
> > odd Rows
> > have a different color.
> > I have a TreeView with Entries which have child, so you can expand and
> > collaps the View ....
> > I tried already to change the background-color with
> > CellRendererText->property_background_gdk(),
> > but so I can only access the background of my cells, but not the area
> > with the arrows to expand and
> > collapse the entries .......
> >
> > Actually what I want is just like the standard-behaviour of the
> > TreeView - white/light-blue background
> > for even/odd rows. The problem is, that the TreeView behaves only
> > under Linux/Unix like this, under
> > Windows the background is only white.
> >
> > thanks
> >
> > gizmo
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.5 (GNU/Linux)
> > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> >
> > iD8DBQFEDs9JWtOLqJ6H0JYRAvL7AKCWSfQwfmTlh24W0xu9UzJXLm+6CACgu2+X
> > hFFlnYFNzjjqb3EkBRdaJQs=
> > =DGu4
> > -----END PGP SIGNATURE-----
> >
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >
> The colors that Gtk::TreeRows are colored depends on the theme you are 
> using.
> Create a gtkrc file for your project.  There are some examples online.
> Add it to your project...
> 
> gtk_rc_parse( FILENAME );
> 
> You can add something like :
> 
> 
> style "treeview"{
> 
> 
>    GtkTreeView::even-row-color = "white"
>    GtkTreeView::odd-row-color = "blue"   }
> 
> 
> class "GtkTreeView" style "treeview"
> 
> 
> to a gtkrc file to get the colors you want.
> 
> 
> Jason
> 
> 
> 
> -- 
> Jason Burchfield
> CAS, Inc.
> (256) 971-6096
> Jason.Burchfield at cas-inc dot com
> 



hi,
I added the file "gtkrc" to my project with following contents:
(colors doesnt make sense .....)

  style "treeview"
  {
    GtkTreeView::even-row-color = "#000000"
    GtkTreeView::odd-row-color  = "#FFFFFF"
  }

  widget_class "GtkTreeView" style "treeview"

and added the line 
  gtk_rc_parse("./gtkrc");
to my code ..... but the treeview doesnt be affected, there are no changes.

so my main looks like this now :

  int main(int argc, char **argv) {
  
    Gtk::Main kit(argc, argv);
    gtk_rc_parse("./gtkrc");
    Gtk::Window *win = new TreeViewTest();
    kit.run(*win);
    delete win;
    return 0;
}
what am I doing wrong ?

Im using Gtkmm - but since the Gtk::TreeView doesnt work for windows (linker
error) I wrote my own TreeView-Class which just wraps a
Gtk+-GtkTreeView-object, I just mention this, because maybe it can be
interesting for the form of the gtkrc-file.

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl



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