repos
/
qt.examples
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
Use new qt:with-app.
Annotate for file /src/launcher.lisp
2009-04-14 tobias
1
;;; Copyright 2009 Tobias Rautenkranz
14:29:22 '
2
;;; License: X11 license
'
3
2009-04-05 tobias
4
(in-package :qt.examples)
15:36:46 '
5
'
6
(defclass launcher (qt:widget)
'
7
()
'
8
(:metaclass cxx:class))
'
9
'
10
(defun make-launcer-button (function)
'
11
(let ((button (make-instance 'qt:push-button
'
12
:args (list (or (documentation function 'function)
'
13
(format nil "~A" function))))))
2009-04-17 tobias
14
(qt:connect (qt:get-signal button "clicked()")
15:29:23 '
15
#'(lambda () (funcall function)))
2009-04-05 tobias
16
button))
15:36:46 '
17
'
18
'
19
(defmethod initialize-instance :after ((launcher launcher) &rest args)
'
20
(declare (ignore args))
'
21
(let ((layout (make-instance 'qt:vbox-layout :args (list launcher))))
'
22
(do-external-symbols (example :qt.examples)
'
23
(when (fboundp example)
'
24
(cxx:add-widget layout (make-launcer-button (symbol-function example)))))
2009-05-11 tobias
25
(setf (cxx:layout launcher) layout)))
2009-04-05 tobias
26
15:36:46 '
27
(defun launcher ()
'
28
"Launch the Qt examples"
2009-07-01 tobias
29
(qt:with-app ()
2009-04-05 tobias
30
(let ((launcher (make-instance 'launcher)))
15:36:46 '
31
(cxx:show launcher)
2009-07-01 tobias
32
(qt:exec))))