Views User Guides > Gadgets > Views Gadgets > View Frames > Managing View Frames
Managing View Frames
This section covers the following topics:
Creating a Client View
When created, a view frame has no client view. To add a client view to a view frame, you must create a child window inside it:
IlvGadgetContainer* clientView =
new IlvGadgetContainer(vframe, IlvRect(0, 0, 200, 200));
The view frame is resized to fit the client view geometry.
Note: The client view can be any instance of any subclass of IlvView.
To know the client view associated with a view frame, use:
IlvView* clientView = vframe->getClient();
Note: A view frame should only handle one client view.
Changing the Title Bar
The title bar consists of an icon, a title, and three buttons.
The Title Bar of a View Frame
To change the icon of the title bar, use the method setIcon:
IlvBitmap* bitmap = ...
vframe->setIcon(bitmap);
To change its title, use the method setTitle:
vframe->setTitle("Frame Title");
The three buttons to the right of the title bar are used to switch to one of the three states that a frame can have. These are detailed below.
Changing the View Frame Menu
Each view frame has a pop-up menu that is displayed when you click the icon located on the left end of the title bar.
The Pop-up Menu of a View Frame
By default, the pop-up menu of a view frame contains the following choices: Restore, Minimize, Maximize, and Close. You can however add new items to it.
To access this menu, use:
IlvPopupMenu* popup = vframe->getMenu();
Published date: 05/24/2022
Last modified date: 02/24/2022