Finding the widgets

The widgets already added to simulation can be retrieved by their name (must be set in property table) using one of following function
1.  gui.find(name);
returns the first component from the root desktop by a specified
name value
2.  gui.find(parentObject,name)
returns the first child component for the
parent by a specified name value

//get dialog object in simulation having name "dialog1"
var dlg=gui.find("dialog1"); 
//get button object in this dialog object having name "button1"