GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Aug 23, 2016 9:04 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: GtkComboBox in a GtkTreeView
PostPosted: Sat Feb 16, 2013 5:22 pm 

Joined: Sat Feb 16, 2013 4:39 pm
Posts: 1
Hello World,

I have GtkTreeView (with a ListStore, so it's more a list actually) and I want to but a ComboBox into one of the columns. How I do that? Is there example code somewhere?

I have tried several thing, but failed. The code (it is a bit too much to post) can be found here

What do I need to change in order to make it work?

TIA and best regards

 Post subject: Re: GtkComboBox in a GtkTreeView
PostPosted: Sun Mar 24, 2013 11:13 am 
Familiar Face

Joined: Wed Jan 30, 2013 8:28 pm
Posts: 20
you can't pack any kind of widget in a GtkTreeView making some list of widgets or tree of widgets. The only thing that is available on gtk is to put some widgets in the cell when editing this cell. For that GtkcellrendererCombobox ( or GtkCellRendererCombo ) is for you.
Just create a GtkTreeView, then a GtkListStore (for a list of strings etc ...), a GtkTreeViewColumn and finaly a GtkCellRendererCombobox for the rendering of the cell. When some user double click on one cell in this GtkTreeView, a combobx is placed for editing and after editing, this combobox is removed from the cell and the new text appear in that place.

( GtkCellRenderer is must like a delegate on Qt )

Best regards,

NB: have a look on gtk source code is good for you.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group