GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can i insert custom widget in colum of gtk tree view ?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Tue Jan 19, 2010 8:51 am    Post subject: How can i insert custom widget in colum of gtk tree view ? Reply with quote

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

PostPosted: Tue Jan 19, 2010 9:20 am    Post subject: Reply with quote

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

PostPosted: Tue Jan 19, 2010 9:23 am    Post subject: Reply with quote

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

PostPosted: Tue Jan 19, 2010 9:37 am    Post subject: Reply with quote

Thanks Tadej
its work now.
Back to top
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Tue Jan 19, 2010 10:38 am    Post subject: Reply with quote

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

PostPosted: Tue Jan 19, 2010 2:51 pm    Post subject: Reply with quote

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

PostPosted: Tue Jan 19, 2010 3:05 pm    Post subject: Reply with quote

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

PostPosted: Wed Jan 20, 2010 2:56 am    Post subject: Reply with quote

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

PostPosted: Wed Jan 20, 2010 9:19 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP