C++ - change the cursor in an X Window

点点圈 提交于 2019-12-05 15:12:33
#include <X11/cursorfont.h>

/* ... */

Cursor c;

c = XCreateFontCursor(dpy, XC_xterm); 
XDefineCursor(dpy, w, c);

Where dpy is your display, w is your window and XC_xterm is a constant defining the shape of your cursor. Here's a list of available cursor shape, along with images.

Looks like the equivalent of a SetCursor call is XDefineCursor. You can get a Cursor id by calling XCreateFontCursor and passing in one of the shapes from X11/cursorfont.h.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!