mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-14 21:15:50 +01:00
WINGs: add functions to set widget background image
With this patch we can set widget background image. As now, only background color was available.
This commit is contained in:
committed by
Carlos R. Mafra
parent
47ac986b53
commit
c10469264d
@@ -100,7 +100,8 @@ static W_View *createView(W_Screen * screen, W_View * parent)
|
||||
view->attribFlags = CWEventMask | CWBitGravity;
|
||||
view->attribs = defAtts;
|
||||
|
||||
view->attribFlags |= CWBackPixel | CWColormap | CWBorderPixel;
|
||||
view->attribFlags |= CWBackPixel | CWColormap | CWBorderPixel | CWBackPixmap;
|
||||
view->attribs.background_pixmap = None;
|
||||
view->attribs.background_pixel = W_PIXEL(screen->gray);
|
||||
view->attribs.border_pixel = W_PIXEL(screen->black);
|
||||
view->attribs.colormap = screen->colormap;
|
||||
@@ -496,6 +497,20 @@ void W_SetViewBackgroundColor(W_View * view, WMColor * color)
|
||||
}
|
||||
}
|
||||
|
||||
void W_SetViewBackgroundPixmap(W_View *view, WMPixmap *pix)
|
||||
{
|
||||
if (view->backImage)
|
||||
WMReleasePixmap(view->backImage);
|
||||
view->backImage = WMRetainPixmap(pix);
|
||||
|
||||
view->attribFlags |= CWBackPixmap;
|
||||
view->attribs.background_pixmap = pix->pixmap;
|
||||
if (view->flags.realized) {
|
||||
XSetWindowBackgroundPixmap(view->screen->display, view->window, pix->pixmap);
|
||||
XClearWindow(view->screen->display, view->window);
|
||||
}
|
||||
}
|
||||
|
||||
void W_SetViewCursor(W_View * view, Cursor cursor)
|
||||
{
|
||||
view->cursor = cursor;
|
||||
|
||||
Reference in New Issue
Block a user