Skip to content

Instantly share code, notes, and snippets.

@wedesoft
Last active February 5, 2017 12:37
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wedesoft/3993305 to your computer and use it in GitHub Desktop.
Save wedesoft/3993305 to your computer and use it in GitHub Desktop.
Small GUI example using Steel Bank Common Lisp, Quicklisp, CommonQt, and Qt4.
#!/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