public bool HistoryItemSelected(TreeSelection selection, TreeModel model, TreePath path, bool path_currently_selected) { int current = path.Indices[0]; if (!path_currently_selected) { while (PintaCore.History.Pointer < current) { PintaCore.History.Redo (); } while (PintaCore.History.Pointer > current) { PintaCore.History.Undo (); } } return true; }