gtk3 combobox

The combobox shows nothing?
Then you lack a renderer.
add it this way:

addnodecombo = self.builder.get_object("addnodecombo") # in my case get the combo box from gtk.Builder
addnodecomborender=Gtk.CellRendererText() # create a renderer
addnodecombo.pack_start(addnodecomborender, True) # add the renderer (what True does I haven't looked up)

# set the column (in my case 0)
# this can be a different column as the id column.
# what "text" does is most probably setting a column name which isn't shown. I think it can be everything
addnodecombo.add_attribute(addnodecomborender, "text", 0)

Advertisements

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s