GtkCellRendererCombo is weird

I’m using a GtkCellRendererCombo on a GtkTreeView based on this example, it works but it doesn’t show any hint at it being a combobox (like no down arrow next to the value), and to edit the value you need to first select the row.
How can I:

  1. Make it show a down arrow next to the value so user understands that this is a combo
  2. Make it selectable on direct click, without having to select the row first (requiring two clicks) .

GtkCellRendererToggle is visible and selectable on single click using the same code, so why is Combo not the same?

Thanks (why is everything so difficult in Gtk? :frowning: )

I think this is a theming issue; you may want to open an issue and propose it to the Adwaita theme designers.

As far as I can see, you can’t. You have to select the row first in order to trigger the editable state, which makes sense otherwise you would never be able to select the row at all. There’s the additional gotcha that cell renderers are not widgets, so they don’t strictly behave like widgets.

You may want to look at other widgets, if your data set is small enough; for instance you could use GtkListBox, which has the added advantage of being a real containers, using real widgets. The downside is that it doesn’t scale to thousands of rows.

Probably because we haven’t had a chance yet to implement gtk_do_what_I_mean(); I assume it’ll be easier once we have GtkTimeMachine.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.