<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Martin Kielhorn</b> <span dir="ltr"><<a href="mailto:kielhorn.martin@googlemail.com">kielhorn.martin@googlemail.com</a>></span><br>
Date: 2009/10/7<br>Subject: Re: [cells-gtk-devel] Editable Table<br>To: Peter Hildebrandt <<a href="mailto:peter.hildebrandt@gmail.com">peter.hildebrandt@gmail.com</a>><br><br><br><br><br><div class="gmail_quote">2009/10/7 Peter Hildebrandt <span dir="ltr"><<a href="mailto:peter.hildebrandt@gmail.com" target="_blank">peter.hildebrandt@gmail.com</a>></span><div class="im">
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br></div><div>Hi Martin,</div><div><br></div><div>here's the object inspector I wrote:</div></blockquote></div></div><br>Thanks for the fast response.<br>Your code looks interesting. I'll try to make something out of it later.<br>
I have to get rid of the references to obj and net-editor first.<br><br>Yesterday I understood the tree-view example and managed to change it,<br>so that it will only display a table. If an entry isn't parsed as a single-float I draw it red:<div class="im">
<br>
<br>(require :asdf)<br>(require :cells-gtk)<br><br>(defpackage :mk<br></div> (:use :cl :cells :cells-gtk))<br><br>(in-package :mk)<br><br>(defmodel mk-app (gtk-app)<br> ()<br> (:default-initargs<br> :md-name :mk-app<br>
:width 300<br> :height 200<div class="im"><br> :kids (c-in nil)))<br><br>(init-gtk)<br></div>(start-win 'mk-app)<br><br>(defmodel node (family)<br> ((thickness :accessor thickness <br> :initarg :position <br>
:initform (c-in (coerce (random 100) 'single-float)))<div class="im"><br>
(curvature :accessor curvature <br> :initarg :curvature <br></div> :initform (c-in (coerce (random 100) 'single-float)))))<br><br>(defparameter *root*<br> (make-instance 'node<br> :md-name :tree<br>
:kids (kids-list? <br> (make-kid 'node)<br> (make-kid 'node)<br> (make-kid 'node))))<br><br>(def-cells-tree-view node-tree ()<br>
(thickness :title "Thickness"<br> :type :string<br> :writer-fn #'(lambda (val) (format t "writer-fn ~a~%" val) (read-from-string val))<br> :reader-fn #'(lambda (val) (format t "reader-fn ~a~%" val) (prin1-to-string val))<br>
:render-fn #'(lambda (node) (if (eql 'single-float (type-of (thickness node)))<br> '(:editable t :foreground "black")<br> '(:editable t :foreground "red"))))<br>
(curvature :title "Curvature"))<br><br>(setf <br> (kids (find-widget :mk-app))<br> (list <br> (mk-vbox <br> :fm-parent (find-widget :mk-app)<br> :kids<br> (kids-list? <br> (mk-node-tree *root* :expand t :fill t :md-name :tree-1)))))<div>
<div></div><div class="h5"><br>
<br>Regards, Martin<br clear="all"><br>-- <br>Martin Kielhorn<br>Randall Division of Cell & Molecular Biophysics<br>King's College London, New Hunt's House<br>Guy's Campus, London SE1 1UL, U.K.<br>tel: +44 (0) 207 848 6519, fax: +44 (0) 207 848 6435<br>
</div></div></div><br><br clear="all"><br>-- <br>Martin Kielhorn<br>Randall Division of Cell & Molecular Biophysics<br>King's College London, New Hunt's House<br>Guy's Campus, London SE1 1UL, U.K.<br>tel: +44 (0) 207 848 6519, fax: +44 (0) 207 848 6435<br>