2D Graphics > Creating Prototypes in Rogue Wave Views Studio > Creating an Instance of a Prototype
 
Creating an Instance of a Prototype
Once a prototype has been created, it can be instantiated in an application buffer window. The application will have access to its attributes when it loads the panel or it can dynamically add instances representing application objects.
You are going to create an instance of your prototype in an application buffer window.
1. To open a buffer window, choose New from the File menu and then 2D Graphics from the submenu that is displayed.
The buffer window is opened in the Main window. This buffer window can hold prototypes or other graphic objects.
2. Drag the myproto prototype icon from the myLib Prototypes palette to the Main window.
The prototype instance is created and is selected.
3. Go to the Group Inspector panel.
Notice that only the Interface and Graphics notebook pages are active. The other notebook pages are not active, so you cannot add behaviors or change the nodes of a prototype instance. You can, however, change the temperature and threshold values. You can also change some global properties of the nodes, such as the capability to zoom in and out. (The instance must remain selected in the Main window.) You can also create several instances of your prototype and give them different values.
In order to access your prototype instance, you will most likely want to give a meaningful name to the instance you have just created.
4. If not still selected, select the instance.
5. In the name field of the Graphics page of the Group Inspector, type myThermometer.
You will be able to retrieve it in your C++ program with the method getGroup(myThermometer) of the IlvGroupHolder class.
6. Choose Save As from the File menu and save this window with the file name myPanel.ilv.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.