X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fcb35b5f0577a323f3289f78cb6c7b3b39217397..c31752dadfe04a196339ee6c592d9971b87539c9:/src/motif/toolbar.cpp diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index 03f2e08a9e..5f920cc7a1 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -164,9 +164,8 @@ wxToolBarTool::~wxToolBarTool() { if ( m_widget ) XtDestroyWidget(m_widget); - if ( m_pixmap ) - XmDestroyPixmap(DefaultScreenOfDisplay((Display*)wxGetDisplay()), - m_pixmap); + // note: do not delete m_pixmap here because it will be deleted + // by the base class when the bitmap is destroyed. } // ---------------------------------------------------------------------------- @@ -285,7 +284,10 @@ bool wxToolBar::Realize() wxControl* control = tool->GetControl(); wxSize sz = control->GetSize(); wxPoint pos = control->GetPosition(); - control->Move(currentX, pos.y); + // Allow a control to specify a y-offset by setting its initial position, + // but still don't allow it to position itself above the top margin. + int controlY = (pos.y > 0) ? currentY + pos.y : currentY; + control->Move(currentX, controlY); currentX += sz.x + packing; break;