Logo Search packages:      
Sourcecode: blender version File versions

GHOST_IWindow * GHOST_SystemCarbon::createWindow ( const STR_String title,
GHOST_TInt32  left,
GHOST_TInt32  top,
GHOST_TUns32  width,
GHOST_TUns32  height,
GHOST_TWindowState  state,
GHOST_TDrawingContextType  type,
const bool  stereoVisual 
) [virtual]

Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.

Parameters:
title The name of the window (displayed in the title bar of the window if the OS supports it).
left The coordinate of the left edge of the window.
top The coordinate of the top edge of the window.
width The width the window.
height The height the window.
state The state of the window when opened.
type The type of drawing context installed in this window.
Returns:
The new window (or 0 if creation failed).

Implements GHOST_ISystem.

Definition at line 384 of file GHOST_SystemCarbon.cpp.

References GHOST_WindowManager::addWindow(), getMilliSeconds(), GHOST_IWindow::getValid(), GHOST_System::m_windowManager, GHOST_System::pushEvent(), and GHOST_WindowManager::setActiveWindow().

{
    GHOST_IWindow* window = 0;

      window = new GHOST_WindowCarbon (title, left, top, width, height, state, type);

    if (window) {
        if (window->getValid()) {
            // Store the pointer to the window 
            GHOST_ASSERT(m_windowManager, "m_windowManager not initialized");
            m_windowManager->addWindow(window);
            m_windowManager->setActiveWindow(window);
            pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window));
        }
        else {
                  GHOST_PRINT("GHOST_SystemCarbon::createWindow(): window invalid\n");
            delete window;
            window = 0;
        }
    }
      else {
            GHOST_PRINT("GHOST_SystemCarbon::createWindow(): could not create window\n");
      }
    return window;
}


Generated by  Doxygen 1.6.0   Back to index