Closing View Frames
When you try to close a view frame (using the Close button for example), the closeFrame method is called. By default, this method invokes the destroy callbacks set for the view frame, which means that if you want to control how a view frame is destroyed, you have to set a destroy callback.
For example:
vframe->setDestroyCallback(DestroyFrame);
with the following callback:
static void DestroyFrame(IlvView* view, IlvAny)
{
IlvIQuestionDialog dlg(view->getDisplay(), "Are you sure ?");
dlg.moveToMouse();
if (dlg.get())
delete view;
}
displays a dialog box asking confirmation to the user before deleting the frame.
Note
If no destroy callback has been set, attempting to close the view frame has no effect. |