|
|
| Author |
Message |
|
|
Saniat Familiar Face
Joined: 24 Dec 2009 Posts: 23
|
Posted: Tue Jan 19, 2010 8:51 am Post subject: How can i insert custom widget in colum of gtk tree view ? |
|
|
Hi
How can i insert a custom widget in column of gtk tree view ? or what is the procedure to insert button,label in the column of the gtk tree view?i am new in gtk...
thanx in advance. |
|
| Back to top |
|
 |
tadeboro Never Seen the Sunlight
Joined: 23 Jul 2008 Posts: 2114 Location: Slovenia
|
Posted: Tue Jan 19, 2010 9:20 am Post subject: |
|
|
Hello.
You can insert custom widget inside column header using gtk_tree_view_column_set_widget() function call.
Tadej |
|
| Back to top |
|
 |
Saniat Familiar Face
Joined: 24 Dec 2009 Posts: 23
|
Posted: Tue Jan 19, 2010 9:23 am Post subject: |
|
|
Thaks for the reply...
can you please give some sort of example code..
i am very new in gtk...
thanks again. |
|
| Back to top |
|
 |
Saniat Familiar Face
Joined: 24 Dec 2009 Posts: 23
|
Posted: Tue Jan 19, 2010 9:37 am Post subject: |
|
|
Thanks Tadej
its work now. |
|
| Back to top |
|
 |
Saniat Familiar Face
Joined: 24 Dec 2009 Posts: 23
|
Posted: Tue Jan 19, 2010 10:38 am Post subject: |
|
|
Hi,
in each row how can i insert widget(custom/button/label etc.)?
thanx in advance. |
|
| Back to top |
|
 |
Joel GTK+ Guru
Joined: 06 Apr 2008 Posts: 225 Location: Fortress of solitude
|
Posted: Tue Jan 19, 2010 2:51 pm Post subject: |
|
|
I think you can, same procedure to add types in your list store, use G_TYPE_OBJECT.
Don't ask me for the code..I'm just giving you the pointers :P |
|
| Back to top |
|
 |
tadeboro Never Seen the Sunlight
Joined: 23 Jul 2008 Posts: 2114 Location: Slovenia
|
Posted: Tue Jan 19, 2010 3:05 pm Post subject: |
|
|
Hello.
First, do not post the same question across many posts. Use this thread or create new thread.
Now, tree view cannot hold widgets. Entire contents is drawn using cell renderers and you're limited to the types provided by GTK+ for the moment. You can write your own cell renderer, but be aware that because cell renderer only has limited functionality compared to widgets, you'll not be able to achieve the same level of interactivity (no prelight, no events, ...).
Tadej |
|
| Back to top |
|
 |
Saniat Familiar Face
Joined: 24 Dec 2009 Posts: 23
|
Posted: Wed Jan 20, 2010 2:56 am Post subject: |
|
|
Thanks for your reply.
so using cell renderer can i able to insert a custom widget?i got a site http://scentric.net/tutorial/sec-custom-cell-renderers.html but can not insert an widget in it.
please give me an example or a sort of code that i can insert a button/label using cell renderer in a tree view.after analysis the providing code then i will insert my custom widget into there.
thanks in advance.
(NB:sorry for multiple posts at the same topic)
auni |
|
| Back to top |
|
 |
tadeboro Never Seen the Sunlight
Joined: 23 Jul 2008 Posts: 2114 Location: Slovenia
|
Posted: Wed Jan 20, 2010 9:19 am Post subject: |
|
|
Hello.
You haven't read my reply well enough. I clearly stated that you cannot insert widgets inside tree view. You can write custom cell render that will imitate certain widget, but widget insertion is not possible.
Tadej |
|
| Back to top |
|
 |
|