Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual
Page 126

KTD-S0057-I
Page 122 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
xbtn.backcol =
backcol.pixel;
xbtn.linecol1 = WhitePixel (disp, screen);
xbtn.linecol2 =
linecol.pixel;
xbtn.textcol =
BlackPixel (disp, screen);
xbtn.font
=
font1;
strcpy
(xbtn.text,
BTN_TEXT1);
draw_button
(xsys,
xbtn);
quit = TRUE;
break;
case BTN_PICTURE:
XAllocNamedColor (disp, cmap, PICT_FG, &col, &col);
XSetForeground (disp, gc, col.pixel);
XAllocNamedColor (disp, cmap, PICT_BG, &col, &col);
XSetBackground (disp, gc, col.pixel);
pict = XCreateBitmapFromData (disp, win, xbm_bits, xbm_width, xbm_height);
XCopyPlane (disp, pict, win, gc, 0, 0, xbm_width, xbm_height, PICT_X,
(HEIGHT - xbm_height) / 2, 1);
xsys.pict
=
pict;
suppress
=
TRUE;
break;
}
curbtn
=
0;
}
}
else if (e.type == ConfigureNotify)
{
if (e.xconfigure.width != WIDTH || e.xconfigure.height != HEIGHT)
; /* Do something */
}
else if (e.type == Expose)
{
if (e.xexpose.count == 0)
{
XClearWindow
(disp,
win);
XAllocNamedColor (disp, cmap, BACKGND_COL, &backgnd, &backgnd);
XSetForeground (disp, gc, backgnd.pixel);
XFillRectangle (disp, win, gc, 0, 0, WIDTH, HEIGHT);
XAllocNamedColor (disp, cmap, BTN_LINECOL, &linecol, &linecol);
XAllocNamedColor (disp, cmap, BTN_GRAYCOL, &backcol, &backcol);
xbtn.rc
= btn1;
xbtn.backcol =
backcol.pixel;
xbtn.linecol1 = WhitePixel (disp, screen);
xbtn.linecol2 =
linecol.pixel;
xbtn.textcol =
BlackPixel (disp, screen);
xbtn.font
=
font1;
strcpy
(xbtn.text,
BTN_TEXT1);
draw_button
(xsys,
xbtn);