Ejemplo n.º 1
0
 static ::Window make_window(
     const Display& display,
     const VisualInfo& vi,
     const Colormap& cmap,
     unsigned width,
     unsigned height
 )
 {
     ::XSetWindowAttributes swa;
     swa.colormap = cmap.Handle();
     swa.background_pixmap = None;
     swa.border_pixel = 0;
     swa.event_mask = StructureNotifyMask;
     //
     return ::XCreateWindow(
                display,
                RootWindow(display.Get(), vi->screen),
                0, 0, width, height,
                0,
                vi->depth,
                InputOutput,
                vi->visual,
                CWBorderPixel | CWColormap | CWEventMask,
                &swa
            );
 }
Ejemplo n.º 2
0
	Colormap(const Display& display, const VisualInfo& vi)
	 : DisplayObject< ::Colormap>(
		display,
		::XCreateColormap(
			display,
			RootWindow(display.Get(), vi->screen),
			vi->visual,
			AllocNone
		),
		::XFreeColormap,
		"Error creating X Colormap"
	){ }