ugui C# coding, get checkbox status and set highlighted button

OK, I give up, after a-lot of wasted time on 4.6 ugui, i haven’t been able to work it out, my 2 questions are simple

#1) how do i get the bool checkbox status for ugui (New Gui system in 4.6)

I expected something like :

gameObject.transform.FindChild (“MyCheckbox”).GetComponentInChildren().status

I need this because I don’t want the interaction of the checkbox to change anything until an apply button is pressed

#2) How do I highlight the first button programatically?

I explicated something like this :

gameObject.transform.FindChild (“MyButton”).SetHighlighted().

Again, I have a number of panels, when I turn a panel on I want to set the highlight to the default option so the user can then continue and use keyboard/joystiq to choose an option

  1. you can check the status of a toggle (check box) by accessing the Toggle component and it’s isOn property:

(requires using UnityEngine.UI;)

bool result = gameObject.GetComponent<Toggle>().isOn;
  1. To highlight a button you need to set it as selected on the EventSystem:

(requires using UnityEngine.EventSystems;
using UnityEngine.UI;)

// assuming Button selectButton pointing to the button you want to select

EventSystem eventSystem = GameObject.Find("EventSystem").GetComponent<EventSystem>();
eventSystem.SetSelectedGameObject(selectButton.gameObject, new BaseEventData(eventSystem));