]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/toolbar.cpp
make sure we don't keep a focus pointer to a window that gets deleted
[wxWidgets.git] / src / motif / toolbar.cpp
index 03f2e08a9e3f6cdbc8ada9fa4409b0174bf27d98..f62b739ad04f07d0afe70b4d83944ccd22d49007 100644 (file)
@@ -285,7 +285,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;