GtkD: How to respond to cell edit's?

Johnson Jones via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 17 17:27:05 PDT 2017


I should also mention that when I use an ID to do what I 
want(again, something I don't want to do), I also need to get the 
column that was edited. This is because I'm using one delegate 
for all the edits.


auto cb = delegate(string index, string text, CellRendererText r)
{
     // How to get the column of that we are editing? An index 
would be fine.
     writeln(index, " - ", text);
};

RT1.addOnEdited(cb);
RT2.addOnEdited(cb);
RT2.addOnEdited(cb);

Looks like I might have to use separate edit handlers ;/

I wonder if I can somehow template it so I can do something like


RT1.addOnEdited(cb!1);
RT2.addOnEdited(cb!2);
RT2.addOnEdited(cb!3);

without having to write a bunch of code to make it happen. Maybe 
there is a library function that can help?




More information about the Digitalmars-d-learn mailing list