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