tags:

views:

42

answers:

1

Hello,

I have a requirement in which i need to display in formation in a table with 4 columns with header to it.

+-----------------+-----------------+-----------------+
|Header 1         |Header 2         |Header 3         |
+-----------------+-----------------+-----------------+-+
|GtkLabel Info 1  | GtkLabel Info 1 | GTKImage Info 1 |S|
|GtkLabel Info 2  | GtkLabel Info 2 | GTKImage Info 2 |C|
|GtkLabel Info 3  | GtkLabel Info 3 | GTKImage Info 3 |R|
|GtkLabel Info 4  | GtkLabel Info 4 | GTKImage Info 4 |O|
|GtkLabel Info 5  | GtkLabel Info 5 | GTKImage Info 5 |L|
|GtkLabel Info 6  | GtkLabel Info 6 | GTKImage Info 6 |L|
+-----------------+-----------------+-----------------+-+

When user clicks (Right/Left) on any of the row i need to popup some menu. so every row need to have some unique id or something like that so that i will get to know which contact has been selected. Plus i need to highlight selected row with some different color.

SO is there any widget in GTK that supports this functionality?

I tried with table but it is not giving me proper results as i want it.

Thanks, PP.

+3  A: 

GTK TreeView

GTK TreeModel (docs) allow store custom objects and GTK CellRenderer-s (docs) help you to display items using custom colors and fonts.

I don't know which language do you use, but there are the good tutorials for Ruby and Python. PyGtk FAQ will help you.

demas
Thanks for reply, I am using GTK+ under C. can you provide some examples on this.
PP
Try this http://scentric.net/tutorial/
demas