GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Aug 30, 2014 4:12 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 
Offline

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 https://bitbucket.org/StarFire/lrc/src/d1b9a3b29213a0388644a7ee1b8066c35c89af57/src/gui?at=default

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

TIA and best regards
Andreas


Top
 Profile  
 
 Post subject: Re: GtkComboBox in a GtkTreeView
PostPosted: Sun Mar 24, 2013 11:13 am 
Offline
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.


Top
 Profile  
 
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: Yahoo [Bot] and 1 guest


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