Skip to content

Instantly share code, notes, and snippets.

@ecelis
Created January 25, 2025 23:39
Show Gist options
  • Select an option

  • Save ecelis/203bbea716eb657bc5ac2450a19f3221 to your computer and use it in GitHub Desktop.

Select an option

Save ecelis/203bbea716eb657bc5ac2450a19f3221 to your computer and use it in GitHub Desktop.

Revisions

  1. ecelis created this gist Jan 25, 2025.
    18 changes: 18 additions & 0 deletions gui.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #include <X11/Xlib.h>

    int main() {
    XEvent event;
    Display* display = XOpenDisplay(NULL);
    Window w = XCreateSimpleWindow(display, DefaultRootWindow(display), 50, 50, 250, 250, 1, BlackPixel(display, 0), WhitePixel(display, 0));
    XMapWindow(display, 0);
    XSelectInput(display, w, ExposureMask);

    for (;;) {
    XNextEvent(display, &event);
    if (event.type == Expose) {
    XDrawString(display, w, DefaultGC(display, 0), 100, 100, "That's all folks!", 20);
    }
    }

    return 0;
    }