xcb:一个简单的窗口

版权声明:本文为博主原创文章,仅供学习参考,转载请注明出处,谢谢! https://blog.csdn.net/Rong_Toa/article/details/85723719
#include <unistd.h>
#include <xcb/xcb.h>

int 
main()
{
	xcb_connection_t *conn;
	xcb_screen_t *screen;
	xcb_window_t win;

	conn = xcb_connect(NULL,NULL);

	screen = xcb_setup_roots_iterator(xcb_get_setup(conn)).data;

	win = xcb_generate_id(conn);

	xcb_create_window(conn,
			XCB_COPY_FROM_PARENT,
			win,
			screen->root,
			0,0,
			150,150,
			10,
			XCB_WINDOW_CLASS_INPUT_OUTPUT,
			screen->root_visual,
			0,NULL);
	xcb_map_window(conn, win);

	xcb_flush(conn);

	pause();
	return 0;
}

猜你喜欢

转载自blog.csdn.net/Rong_Toa/article/details/85723719