Establishing the locale and opening an XIM

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/qq_32768743/article/details/89737083
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xlocale.h>
#include <cstdlib>

int main() {
    Display *display;
    XIM im;
    if (setlocale(LC_ALL, "") == NULL) {
        printf("cannot set locale");
        exit(1);
    }
    if((display = XOpenDisplay(NULL)) == NULL) {
        printf("cannot open Display");
        exit(1);
    }
    if(!XSupportsLocale()) {
        printf("X does not support local %s", setlocale(LC_ALL, NULL));
        exit(1);
    }
    if(XSetLocaleModifiers("") == NULL) {
        printf("Warning: cannot set local modifiers");
        exit(1);
    }
    if((im = XOpenIM(display, NULL, NULL, NULL)) == NULL) {
        printf("Couldn't open input method");
        exit(1);
    }
    printf("Done!");
    return 0;
}

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_32768743/article/details/89737083