# Is it possible to create split windows with separate controls in Cinder?

**URL:** <https://discourse.libcinder.org/t/is-it-possible-to-create-split-windows-with-separate-controls-in-cinder/1484>\
**Category:** Using Cinder\
**Created:** [April 16, 2019, 11:15am UTC](https://discourse.libcinder.org/t/is-it-possible-to-create-split-windows-with-separate-controls-in-cinder/1484 "2019-04-16T11:15:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [April 16, 2019, 11:27am UTC](https://discourse.libcinder.org/t/is-it-possible-to-create-split-windows-with-separate-controls-in-cinder/1484/3 "2019-04-16T11:27:50Z")

</div>

> …window through the createWindows() creates only a clone of the first window

This isn’t true. Your application will call the `::draw` function once per window, so if you’re not checking which is the current window, you’ll draw the same thing into each one. Once multiple windows are involved, my preference is to remove the overridden `App::draw` virtual method and use signals instead.

```cpp
// Written inline so not guaranteed to compile
void YourApp::setup ( )
{
    auto mainWindow = getWindow();
    auto secondWindow = createWindow( ... );

    mainWindow->getSignalDraw().connect ( [=] { drawMainWindow(); } );
    secondWindow->getSignalDraw().connect ( [=] { drawSecondWindow(); } );  
}

void YourApp::drawMainWindow ( )
{
    // getWindow[X]() here refers to mainWindow from above;
    gl::setMatricesWindow ( getWindowSize() ); 
    gl::clear ( Colorf ( 1, 0, 0 ) );
}

void YourApp::drawSecondWindow ( )
{
    // getWindow[X]() here refers to secondWindow from above;
    gl::setMatricesWindow ( getWindowSize() ); 
    gl::clear ( Colorf ( 0, 1, 0 ) );
}

```

The same goes for mouse/keyboard/touch events as well, you just need to connect to the appropriate signals.

---

_[View the full topic](https://discourse.libcinder.org/t/is-it-possible-to-create-split-windows-with-separate-controls-in-cinder/1484)._
