Kontron KTAM3874-pITX Manual de usuario Pagina 124

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 293
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 123
KTD-S0057-I Page 120 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
XEvent e;
Pixmap pict;
XSystem xsys;
XButton xbtn;
char *txt = HEADER;
disp = XOpenDisplay (NULL);
if (disp == (Display *) NULL)
{
fprintf (stderr, "Cannot connect the X server\n");
return EXIT_FAILURE;
}
memset ((void *) &xsys, 0, sizeof (xsys));
memset ((void *) &xbtn, 0, sizeof (xbtn));
xsys.disp = disp;
if (!XMatchVisualInfo (disp, 0, 32, TrueColor, &vinfo))
if (!XMatchVisualInfo (disp, 0, 24, TrueColor, &vinfo))
if (!XMatchVisualInfo (disp, 0, 16, TrueColor, &vinfo))
{
fprintf (stderr, "Cannot get TrueColor Visual\n");
free_resources (xsys);
return EXIT_FAILURE;
}
visual = vinfo.visual;
depth = vinfo.depth;
screen = vinfo.screen;
cmap = XCreateColormap (disp, RootWindow (disp, screen), visual, AllocNone);
wa.background_pixel = WhitePixel (disp, screen);
wa.border_pixel = BlackPixel (disp, screen);
wa.colormap = cmap;
win = XCreateWindow (disp, RootWindow (disp, screen), LEFT, TOP, WIDTH, HEIGHT, BORDER, depth,
InputOutput, visual, CWBorderPixel | CWBackPixel | CWColormap, &wa);
sh.min_width = WIDTH;
sh.min_height = HEIGHT;
sh.flags = PMinSize;
XSetWMNormalHints (disp, win, &sh);
XStringListToTextProperty (&txt, 1, &name);
XSetWMName (disp, win, &name);
xsys.win = win;
xsys.screen = screen;
xsys.cmap = cmap;
gc = XCreateGC (disp, win, 0, NULL);
if (! gc)
{
fprintf (stderr, "Cannot create graphics context\n");
free_resources (xsys);
return EXIT_FAILURE;
}
Vista de pagina 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 292 293

Comentarios a estos manuales

Sin comentarios