+ if (pm->mask == None) return; // no mask for the button, leave it empty
+
+ width = _rect.width();
+
+ otk::Pen pen(_focused ? *_style->getButtonPicFocus() :
+ *_style->getButtonPicUnfocus());
+
+ // set the clip region
+ XSetClipMask(otk::Display::display, pen.gc(), pm->mask);
+ XSetClipOrigin(otk::Display::display, pen.gc(),
+ (width - pm->w)/2, (width - pm->h)/2);
+
+ // fill in the clipped region
+ XFillRectangle(otk::Display::display, _window, pen.gc(),
+ (width - pm->w)/2, (width - pm->h)/2,
+ (width + pm->w)/2, (width + pm->h)/2);
+
+ // unset the clip region
+ XSetClipMask(otk::Display::display, pen.gc(), None);
+ XSetClipOrigin(otk::Display::display, pen.gc(), 0, 0);
+ }