Last active
April 10, 2025 09:23
-
-
Save wedesoft/3993305 to your computer and use it in GitHub Desktop.
Small GUI example using Steel Bank Common Lisp, Quicklisp, CommonQt, and Qt4.
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
#!/usr/bin/sbcl --script | |
; Also see http://pleasegodno.wordpress.com/common-lisp-tutorials/common-lisp-gui-programming-with-commonqt/introduction-to-commonqt/ | |
; or see http://kvardek-du.kerno.org/2011/12/setting-up-commonqt-on-osx.html if you're still using Mac OS | |
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(when (probe-file quicklisp-init) | |
(load quicklisp-init))) | |
(ql:quickload 'qt) | |
(defpackage :hello-qt | |
(:use :cl :qt) | |
(:export #:main)) | |
(in-package :hello-qt) | |
(named-readtables:in-readtable :qt) | |
;;;;Hello Qt | |
(defun hello-qt() | |
(let* ((app (make-qapplication)) | |
(label (#_new QLabel "<strong>Hello Qt!</strong>"))) | |
(#_setWindowTitle label "Hello, Qt!") | |
(#_resize label 100 100) | |
(#_show label) | |
(unwind-protect | |
(#_exec app) | |
(#_hide label)))) | |
(hello-qt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment