14. Creating a Frame at Runtime : How You Can Build a Frame Dynamically : How You Can Create the Script : How You Can Attach the Frame to the Application
 
Share this page                  
How You Can Attach the Frame to the Application
After you have completed all of the frame elements and attached them to the frame, you must attach the frame itself to the application by setting the ParentApplication attribute of the new frame's FrameSource object. The value to which you set this attribute must be the same value that is in the ParentApplication attribute of the currently executing frame. (The currently executing frame is a frame of your dynamic application.)
To access the ParentApplication attribute of a currently active frame, use the ObjectSource attribute of the frame's FrameExec object. Whenever you call or open a frame, OpenROAD creates a FrameExec object for that instance of opening or calling. The FrameExec object gives you information about the current state of a running frame. The ObjectSource attribute points to the frame's FrameSource object. The ParentApplication attribute is defined for the FrameSource object.
For example, the DynamicFrame frame attaches the generated test_frame frame to the currently executing frame (the starting frame) by assigning the value of the ParentApplication attribute of the current frame's FrameSource object to the corresponding attribute of the generated frame's FrameSource object:
test_frame.ParentApplication =
CurFrame.ObjectSource.ParentApplication;
For an example of attaching a frame to an application, see How You Can Add the Frame to the Application (see How You Can Add the Frame to the Application).