mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-09-09 02:06:33 +00:00
graphics/twm4nx/src/cbackground.cxx: Should set the initial background color immediately without waiting for a redraw.
This commit is contained in:
parent
9eb7db731e
commit
e50bbaac3a
1 changed files with 19 additions and 0 deletions
|
|
@ -246,6 +246,25 @@ bool CBackground::createBackgroundWindow(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Get the graphics port for drawing on the background window
|
||||
|
||||
NXWidgets::CGraphicsPort *port = control->getGraphicsPort();
|
||||
|
||||
// Get the size of the region to redraw (the whole display)
|
||||
|
||||
struct nxgl_size_s windowSize;
|
||||
if (!m_backWindow->getSize(&windowSize))
|
||||
{
|
||||
twmerr("ERROR: getSize failed\n");
|
||||
delete m_backWindow;
|
||||
m_backWindow = (FAR NXWidgets::CBgWindow *)0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Fill the display with the background color
|
||||
|
||||
port->drawFilledRect(0, 0, windowSize.w, windowSize.h,
|
||||
CONFIG_TWM4NX_DEFAULT_BACKGROUNDCOLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue