I have a button whose behavior is to create or delete a frame window with close button enabled, like that:
Code: Select all
bool onButtonPressed(const EventArg&e)
{
if (!WindowManager::getSingletonPtr()->isWindowPresent(windowName))
{
// Create Window
}
}
Here is the code of the Subscriber of Window closeButton pressed:
Code: Select all
bool onCloseButtonPressed(const EventArg& e)
{
const WindowEventArg& we = static_cast<const WindowEventArg&>(e);
destroyWindow(we.window);
}
The problem is everything work quick the first time i create the window, but the next times, it takes more more time to create it.
Why? How can i make thing work better?