[Gtk-sharp-list] Different Cellrenderercombo objects per treeview row

Christopher David Howie me at chrishowie.com
Tue Aug 10 21:11:48 EDT 2010

On 08/10/2010 04:58 PM, soy wrote:
> Also I've got another problem that seems like it should have an obvious
> answer:  I can't figure out how to get the combo box option the user
> selected.  I figured the text variable on the CellRendererCombo object would
> hold such a value, but it would always return an empty string and the option
> the user selects is never saved in the combobox area.  Is this a bug or am I
> missing something obvious here as well? 

The answer is not really obvious.  I looked into it a bit and found the
path you need to take.  Basically, attach to the renderer's edit-started
event (I forget what it's called).  This will be passed a CellEditable
object in the event args, which you can cast to a ComboBox.  Then bind
to the CellEditable's edit-finished event.  Use the reference to the
ComboBox to extract the selected iter.

Not hard, but definitely not straightforward.

Chris Howie

If you correspond with me on a regular basis, please read this document:

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.

More information about the Gtk-sharp-list mailing list