changing properties in a Treemodel in a Combobox
- From: Carlos Pereira <jose carlos pereira ist utl pt>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: changing properties in a Treemodel in a Combobox
- Date: Mon, 09 Jun 2008 18:30:10 +0100
Hullo,
Is there a way to easily change a property in a GtkTreeModel,
when something else changes in the interface?
I need to disable/enable specific rows (change the sensitivity) in a
GtkComboBox, depending on users actions.
gtk-demo shows how to set the sensitivity of a specific row, when the
tree model is created. To change this sensitivity, the only way I know
is to create a new renderer, with code as this:
gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo));
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
"text", 0, NULL);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), renderer,
set_sensitivity, NULL, NULL);
Different functions set_sensitivity, can then be used
to set different sensitivity states for the whole treemodel.
Is this the right way to change properties in a treemodel,
at least in a combobox, or is there a simpler way to achieve
the same thing?
something like this?
gtk_combo_box_set_sensitive (combo, row, state);
Thanks for all your help!
Carlos
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]