[Gtk-sharp-list] TreeCellDataFunc not getting pinged

Adam Tauno Williams adam at morrison-ind.com
Wed Apr 11 08:31:28 EDT 2007


> > In trying to port my code from NodeView to the more sophisticated
> > TreeView so that I can use the TreeModelFilter
> I was going to confirm your findings but I can't run your example code
> without some further parts, namely Task, taskStore and ToDoFilter. Can you
> post more code?

It might be easier to just come up with a different demo;  this is all
intertwined quite a bit -  http://code.google.com/p/consonance/

Maybe this is enough....

taskStore is just:
ListStore		taskStore;
taskStore = new ListStore(typeof(Task));

public class Task /* Bogus Task Object */
{
	public Task() {}
	public int ObjectId { get { return 1000; }}
	public bool IsToDo { get { return true; }}
}

pop some tasks in with:
taskStore.AppendValues(new Task());
taskStore.AppendValues(new Task());
taskStore.AppendValues(new Task());
taskStore.AppendValues(new Task());


private bool ToDoFilter(Gtk.TreeModel _model, Gtk.TreeIter _iter)
{
  Task task;
  Console.WriteLine("Filtering task for ToDo list");
  task = (Task)_model.GetValue(_iter, 0);
  if (task == null) return false;
  if (task.IsToDo) return true;
  return false;
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20070411/2f05ee71/attachment.bin 


More information about the Gtk-sharp-list mailing list