Posted by dimitris Fri 9th Feb 2007 11:10 - Syntax is None/text - 33 views
Download | New Post | Modify | Hide line numbers
Description:
/*problem*/
when i press the checkbox while the list is sorted list is doing some wired
staff like swaping rows moving the row where i pressed the checkbox last
and all this.SOmetimes it doesnt work at all

  1. $model = new gtkliststore(GTK::TYPE_BOOLEAN,Gtk::TYPE_STRING);
  2.    $model_sort = new GtkTreeModelSort($model);
  3.    $render = new GtkCellRendererToggle();
  4.    $render->set_property('activatable', true);
  5.    $render->connect('toggled', 'on_toggle',$model);
  6.    /after tha goes the lines of creating the text column and filling the list/
  7.    $list -> set_model($model_sort);
  8.  
  9.  
  10.    /function on_toggle
  11.   function on_toggle($renderer, $row,$model,$model_sort) {
  12.    $iter = $model->get_iter($row); // get the iter
  13.     $model->set($iter, 0, !$model->get_value($iter, 0)); // note 5
  14.   }
  15.    
  16.  

PermaLink to this entry https://pastebin.co.uk/10137
Posted by dimitris Fri 9th Feb 2007 11:10 - Syntax is None/text - 33 views
Download | New Post | Modify | Hide line numbers