/ src /
/src/i18n-hello-world.lisp
1 ;;; Copyright 2009 Tobias Rautenkranz
2 ;;; License: X11 license
3
4 (in-package :qt.examples)
5
6 (defun i18n-hello-world ()
7 "i18n hello world"
8 (qt:with-app ()
9 (qt:with-translator ("hello-world"
10 *default-pathname-defaults*
11 *source-path*)
12 (let ((widget (make-instance 'qt:label)))
13 (setf (cxx:window-title widget) (qt:tr "Lisp Qt Example" "hello-world")
14 (cxx:text widget) (format nil (qt:tr "<h1>Hello world</h1>
15
16 You are running ~A version ~A on a ~A ~A")
17 (lisp-implementation-type)
18 (lisp-implementation-version)
19 (software-type)
20 (software-version)))
21 (cxx:show widget)
22 (qt:exec)))))
23
24 ;; FIXME:
25 ;; calling #'software-version from the qt:application event loop
26 ;; segfaults in SBCL. The first call caches the result in
27 ;; sb-sys::*software-version* and we thus prevent the crash in
28 ;; (run-program "/bin/uname" [...]).
29 #+sbcl
30 (smoke:eval-startup (:load-toplevel)
31 (software-version))