how to create zebra stripes in treeview

View: New views
4 Messages — Rating Filter:   Alert me  

how to create zebra stripes in treeview

by Miroslav Biňas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello

i am new to gtk#, so maybe my question is something obvious, but - not
yet for me. so...

my problem is to create stripes in TreeView with ListStore model. i was
trying to search for example, going through some source codes, but
without any success. the best result, what i was able to do, was the
creeation of method for rendering the row for the specific column with
the SetCellDataFunc() method. problem is, when i sort the rows in the
store by clicking on the header, it stops working - sorry - it still
works, but there can be several rows of the same color grouped together
based on the sort criteria.

when i take a look at the available methods and properties of the
ListStore, i can see the properties OddRowColor and EvenRowColor.
according the name it should be exactly, what i am looking for. problem
is, it's only getter and i don't know, how to set it.

so - if anybody knows, how to solve this problem, please, give me at
least a hint ;) the best will be some fragment of code. anyway - i
appreciate any help.

thanks

mirek
--
e-mail: mirek[[at]]cnl.sk
jabber: mirek[[at]]jabbim.sk
homepage: http://www.cnl.tuke.sk/~mirek

english:
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

slovak:
prosim, neposielajte mi prilohy vo formatoch .doc, .docx a .ppt (power
point)
precitajte si http://www.gnu.org/philosophy/no-word-attachments.cs.html

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: how to create zebra stripes in treeview

by Brad Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-06-04 at 19:40 +0200, Miroslav Biňas wrote:

> hello
>
> i am new to gtk#, so maybe my question is something obvious, but - not
> yet for me. so...
>
> my problem is to create stripes in TreeView with ListStore model. i was
> trying to search for example, going through some source codes, but
> without any success. the best result, what i was able to do, was the
> creeation of method for rendering the row for the specific column with
> the SetCellDataFunc() method. problem is, when i sort the rows in the
> store by clicking on the header, it stops working - sorry - it still
> works, but there can be several rows of the same color grouped together
> based on the sort criteria.

Check out TreeView.RulesHint.

http://go-mono.org/docs/monodoc.ashx?link=P%3aGtk.TreeView.RulesHint

Simply:

myTreeView.RulesHint = true;

should do the trick.  If you're on Windows however, you may need to hack
your theme to make them display (as they don't by default).  If this is
the case, let me know and I can tell you how you can get them to show.

Best,

-Brad

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: how to create zebra stripes in treeview

by Jacek R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Donnerstag 04 Juni 2009 19:40:42 schrieb Miroslav Biňas:
> my problem is to create stripes in TreeView with ListStore model.
>
Try this:

            TreeView priceMatrixTreeView = new TreeView();
            this.priceMatrixTreeView.RulesHint = true;

The RulesHint property switches striping on resp. off.

Regards
Jacek Rużyczka



----------------------------------------------------------------------
Zostan dziennikarzem obywatelskim!
Sprawd� sie >>> http://link.interia.pl/f21b9


_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: how to create zebra stripes in treeview

by Miroslav Biňas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

brad and jacek - thanks - thats exactly what i was looking for. yes - it
works like a charm ;)

thank you one more time

mirek
V Štvrtok, 4. jún 2009 o 20:33 +0200, Jacek Rużyczka napísal(a):

> Am Donnerstag 04 Juni 2009 19:40:42 schrieb Miroslav Biňas:
> > my problem is to create stripes in TreeView with ListStore model.
> >
> Try this:
>
>    TreeView priceMatrixTreeView = new TreeView();
>             this.priceMatrixTreeView.RulesHint = true;
>
> The RulesHint property switches striping on resp. off.
>
> Regards
> Jacek Rużyczka
>
>
>
> ----------------------------------------------------------------------
> Zostan dziennikarzem obywatelskim!
> Sprawd sie >>> http://link.interia.pl/f21b9
>
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@...
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
--
e-mail: mirek[[at]]cnl.sk
jabber: mirek[[at]]jabbim.sk
homepage: http://www.cnl.tuke.sk/~mirek

english:
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

slovak:
prosim, neposielajte mi prilohy vo formatoch .doc, .docx a .ppt (power
point)
precitajte si http://www.gnu.org/philosophy/no-word-attachments.cs.html

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list