in gui WVTreeFrame, move checkbox logic to an isolated function