Created
January 11, 2015 04:07
-
-
Save futuro/5b43dd23618828fe673f to your computer and use it in GitHub Desktop.
hello-world program to show xlib:open-font problems with 9x15bold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun hello-world (width height &optional (host "")) | |
(let* ((display (xlib:open-display host)) | |
(screen (first (xlib:display-roots display))) | |
(black (xlib:screen-black-pixel screen)) | |
(white (xlib:screen-white-pixel screen)) | |
(root-window (xlib:screen-root screen)) | |
(grackon (xlib:create-gcontext | |
:drawable root-window | |
:font "9x15bold" | |
:foreground white | |
:background black)) | |
(my-window (xlib:create-window | |
:parent root-window | |
:x 0 | |
:y 0 | |
:width width | |
:height height | |
:background black | |
:event-mask (xlib:make-event-mask :exposure | |
:button-press)))) | |
(describe (xlib:gcontext-font grackon)) | |
(xlib:map-window my-window) | |
(xlib:event-case (display :force-output-p t | |
:discard-p t) | |
(:exposure (count) | |
(when (zerop count) | |
(xlib:draw-glyphs | |
my-window | |
grackon | |
20 50 | |
"Hello World!")) | |
nil) | |
(:button-press () t)) | |
(xlib:destroy-window my-window) | |
(xlib:close-display display))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment