CellRendererToggle vs. GtkTreeView



Hi!

I am using a GtkTreeView with a column of ToggleButtons.
I attach the 'toggled' signal of the CellRendererToggle to a function.
It is working properly (i see the values in the GtkTreeStore model
alternating), but in the view the togglebutton remains empty. Here is my
item_toggled funtion:

sub item_toggled {
    my ($cell, $path_str, $model) = @_;
    my $path = Gtk2::TreePath->new_from_string ($path_str);
    my $column = 5;
    $iter = $model->get_iter ($path);
    my ($toggle_item) = $model->get ($iter, $column);
    $toggle_item ^= 1;
    debug 'setting '.$path_str.' to '.$toggle_item;
    # set new value
    $model->set ($iter, $column, $toggle_item);
}

(this is almost fully from the examples)

What could be the problem?

-- 
doome




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