-
Notifications
You must be signed in to change notification settings - Fork 0
/
error-reproduction.lisp
55 lines (45 loc) · 1.79 KB
/
error-reproduction.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
(defpackage :clim-error-reproduction
(:use :clim-lisp :clim)
(:export test))
(in-package :clim-error-reproduction)
(defclass special-textual-view (textual-view) ())
(define-presentation-type element () :inherit-from '((string)
:description "element"))
(define-presentation-method present (element (type element) stream
(view special-textual-view)
&key acceptably)
(declare (ignore acceptably))
(formatting-cell (stream :align-x :left)
(format stream "~a" element)))
(define-presentation-method present (element (type element) stream
(view textual-view)
&key acceptably)
(declare (ignore acceptably))
(format stream "~a" element))
(defun display-main (frame stream)
(let ((lines (curr-lines frame)))
(when lines
(formatting-table (stream :x-spacing '(3 :character))
(loop for line in lines
do (formatting-row (stream)
(present line 'element :stream stream :view (make-instance 'special-textual-view))))))))
(define-application-frame error-app ()
((curr-lines :initform nil :accessor curr-lines))
(:panes
(main-display
:application
:display-function 'display-main
:display-time t)
(int :interactor))
(:command-definer define-some-command)
(:layouts
(default (vertically ()
(99/100 main-display)
(1/100 int)))))
(define-some-command (com-go-element :name t) ((element 'element))
t)
(defvar *app*)
(defun test ()
(setf *app* (clim:make-application-frame 'error-app))
(setf (curr-lines *app*) '("Line 1" "Line 2"))
(clim:run-frame-top-level *app*))