diff --git a/graphics/twm4nx/src/cbackground.cxx b/graphics/twm4nx/src/cbackground.cxx index 3ec70c5c7..79e6e3199 100644 --- a/graphics/twm4nx/src/cbackground.cxx +++ b/graphics/twm4nx/src/cbackground.cxx @@ -220,9 +220,22 @@ bool CBackground::createBackgroundWindow(void) FAR CWindowEvent *control = new CWindowEvent(m_twm4nx, true); + // Create the background window (CTwm4Nx inherits from CNxServer) + m_backWindow = m_twm4nx->getBgWindow(control); if (m_backWindow == (FAR NXWidgets::CBgWindow *)0) { + gerr("ERROR: Failed to create BG window\n"); + return false; + } + + // Open the background window + + if (!m_backWindow->open()) + { + gerr("ERROR: Failed to open the BG window\n"); + delete m_backWindow; + m_backWindow = (FAR NXWidgets::CBgWindow *)0; return false; } @@ -243,6 +256,7 @@ bool CBackground:: struct nxgl_size_s windowSize; if (!m_backWindow->getSize(&windowSize)) { + gerr("ERROR: getSize failed\n"); return false; } @@ -257,6 +271,7 @@ bool CBackground:: if (cbitmap == (NXWidgets::CRlePaletteBitmap *)0) { + gerr("ERROR: Failed to create bitmap\n"); return false; } @@ -291,8 +306,9 @@ bool CBackground:: m_backImage = new NXWidgets::CImage(control, imagePos.x, imagePos.y, imageSize.w, imageSize.h, cbitmap); - if (m_backImage != (NXWidgets::CImage *)0) + if (m_backImage == (NXWidgets::CImage *)0) { + gerr("ERROR: Failed to create CImage\n"); delete cbitmap; return false; } diff --git a/include/graphics/nxwidgets/cbgwindow.hxx b/include/graphics/nxwidgets/cbgwindow.hxx index f6fd4ce0c..429a66fb9 100644 --- a/include/graphics/nxwidgets/cbgwindow.hxx +++ b/include/graphics/nxwidgets/cbgwindow.hxx @@ -122,7 +122,7 @@ namespace NXWidgets virtual ~CBgWindow(void); /** - * Creates a the new window. Window creation is separate from + * Creates the new window. Window creation is separate from * object instantiation so that failures can be reported. * * @return True if the window was successfully created.