Re: Questions on Combo inside TreeView



On Mon, 2005-03-14 at 18:13 -0300, Leandro Fanzone wrote:
> Hello. I'm using Gtk::CellRendererCombo to provide a combobox inside a 
> TreeView. I have two questions:
> 
> 1) The Combo is built from a TreeModel. The field selected with 
> property_text_column() is the one to be shown in the combo. How to 
> access the other columns for the selected item in the TreeModel? I mean, 
> if one item is selected, how to access the values entered in the other 
> fields for that item, without having to go through all the children 
> comparing strings?

If you have the TreeModel::iterator then you can use TreeModel::Row[]
just as you would for a TreeView.

You can even display more than one column in the ComboCellRenderer, but
it is quite difficult to achieve, using
Gtk::CellRenderer::signal_start_editing() and pack().

> 2) If I use property_has_entry() = true, it appears an entry I can edit, 
> and a list I can choose from. If that property is false, then there's no 
> entry, and the list is visible only while I'm pressing the mouse button. 
> Now, how can I have a drop down list (that stays on while browsing it 
> without having to hold the mouse button), but without letting the user 
> edit a value that is not in the list?
> 
> Thank you very much,

I doubt that the presence of an entry should affect whether the you must
hold down the mouse to see the drop down list. This is probably
something for the gtk+ mailing list or the gtk+ bugzilla.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]