/[gtk-cffi]/gtk-cffi/examples/ex7.lisp
ViewVC logotype

Diff of /gtk-cffi/examples/ex7.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by rklochkov, Fri Aug 26 17:16:13 2011 UTC revision 1.4 by rklochkov, Mon May 7 09:02:03 2012 UTC
# Line 107  Description of this event. And this desc Line 107  Description of this event. And this desc
107                  (setf (search-column view) i)))))                  (setf (search-column view) i)))))
108    
109  (defun on-click (view path-list)  (defun on-click (view path-list)
110    (destructuring-bind (path column x y) path-list    (when path-list
111      (declare (ignore y))      (destructuring-bind (path column x y) path-list
112      (let ((cell (get-cell-at column x)))        (declare (ignore y))
113        (format t "cell: ~A~%" cell)        (let ((cell (get-cell-at column x)))
114        (when (equal cell *cell-pix*)          (format t "cell: ~A~%" cell)
115          (let ((dialog (make-instance 'dialog :title "Edit text"          (when (equal cell *cell-pix*)
116                                       :parent *window*            (let ((dialog (make-instance 'dialog :title "Edit text"
117                                       :buttons '((:gtk-ok :ok)                                         :parent *window*
118                                                  (:gtk-cancel :cancel)))))                                         :buttons '((:gtk-ok :ok)
119            (let ((text-view (make-instance 'text-view))                                                    (:gtk-cancel :cancel)))))
120                  (iter (path->iter (model view) path)))              (let ((text-view (make-instance 'text-view))
121              (setf (text (buffer text-view))                    (iter (path->iter (model view) path)))
122                    (car (model-values (model view) :columns '(1) :iter iter)))                (setf (text (buffer text-view))
123              (let ((top-area (content-area dialog)))                      (car (model-values (model view) :columns '(1) :iter iter)))
124                (pack top-area text-view :pack-fill t :expand t)                (let ((top-area (content-area dialog)))
125                (show text-view))                  (pack top-area text-view :pack-fill t :expand t)
126              (setf (window-position dialog) :center-on-parent)                  (show text-view))
127                  (setf (window-position dialog) :center-on-parent)
128                ;(pack top-area text-view :fill t :expand t))  
129              (run dialog)                                          ;(pack top-area text-view :fill t :expand t))
130              (setf (model-values (model view) :columns '(1) :iter iter)                (run dialog)
131                    (list (text (buffer text-view))))                (setf (model-values (model view) :columns '(1) :iter iter)
132              (destroy dialog)))))))                      (list (text (buffer text-view))))
133                  (destroy dialog))))))))
134    
135  (main)  (main)
136    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.5