]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/statbox.cpp
OnExit() is called for modules which were initialized even if the init of
[wxWidgets.git] / src / motif / statbox.cpp
index 487d56710bf19a02b876697431a024c27a0a83eb..5d8bf67b59e57c306d3909ff40b6b960d7b1b85a 100644 (file)
@@ -114,15 +114,21 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
                     XmNrightAttachment, XmATTACH_FORM,
                     NULL);
 
-    m_mainWidget = (Widget) formWidget;
+    m_mainWidget = (WXWidget) frameWidget;
+    m_formWidget = (WXWidget) formWidget;
 
     SetCanAddEventHandler(TRUE);
-    AttachWidget (parent, m_mainWidget, (WXWidget) frameWidget, pos.x, pos.y, size.x, size.y);
+    AttachWidget (parent, (WXWidget) frameWidget, (WXWidget) formWidget, pos.x, pos.y, size.x, size.y);
     ChangeBackgroundColour();
 
     return TRUE;
 }
 
+wxStaticBox::~wxStaticBox()
+{
+   DetachWidget(m_formWidget);
+}
+
 void wxStaticBox::SetLabel(const wxString& label)
 {
     if (!m_labelWidget)
@@ -193,10 +199,14 @@ void wxStaticBox::ChangeFont(bool keepOriginalSize)
 void wxStaticBox::ChangeBackgroundColour()
 {
     wxWindow::ChangeBackgroundColour();
+    if (m_labelWidget)
+        DoChangeBackgroundColour(m_labelWidget, m_backgroundColour);
 }
 
 void wxStaticBox::ChangeForegroundColour()
 {
     wxWindow::ChangeForegroundColour();
+    if (m_labelWidget)
+        DoChangeForegroundColour(m_labelWidget, m_foregroundColour);
 }