Tree view function complete.