Andy Chambers | 12 Mar 2008 21:29

celtk cleaning - slot-value-observe

Hi Kenny,

So I'm cleaning up my celtk stuff so I've got a list of wee things that cause problems when asdf installing it that I'll submit patches for over the next few days.  Here's the first...

slot-value-observe seems to take an extra parameter now so I've adjusted my version to the following.  Is this ok to be checked in?

(defmethod slot-value-observe progn (slot-name (self tk-object) new-value old-value old-value-boundp cell)
  (declare (ignorable old-value cell))
  (when old-value-boundp ;; initial propagation to Tk happens during make-tk-instance
    (bwhen (tco (tk-config-option self slot-name)) ;; (get slot-name 'tk-config-option))
      (tk-configure self (string tco) (or new-value "")))))

<div><p>Hi Kenny,<br><br>So I'm cleaning up my celtk stuff so I've got a list of wee things that cause problems when asdf installing it that I'll submit patches for over the next few days.&nbsp; Here's the first...<br><br>
slot-value-observe seems to take an extra parameter now so I've adjusted my version to the following.&nbsp; Is this ok to be checked in?<br><br>(defmethod slot-value-observe progn (slot-name (self tk-object) new-value old-value old-value-boundp cell)<br>
&nbsp; (declare (ignorable old-value cell))<br>&nbsp; (when old-value-boundp ;; initial propagation to Tk happens during make-tk-instance<br>&nbsp;&nbsp;&nbsp; (bwhen (tco (tk-config-option self slot-name)) ;; (get slot-name 'tk-config-option))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (tk-configure self (string tco) (or new-value "")))))<br></p></div>
Andy Chambers | 12 Mar 2008 21:32

celtk cleaning - foreign libraries

I modified the foreign library packages as follows to make it work on my machine.  In a previous email, someone said it worked best (at least for cello) with tcl 8.5 so we might as well make that explicit on unix.

(define-foreign-library Tcl
    (:darwin (:framework "Tcl"))
  (:windows (:or "Tcl85.dll"))
  (:unix (:or "libtcl8.5.so" "libtcl.so"))
  (t (:default "libtcl")))

(define-foreign-library Tk
    (:darwin (:framework "Tk"))
  (:windows (:or "Tk85.dll"))
  (:unix (:or "libtk8.5.so" "libtk.so"))
  (t (:default "libtk")))

(define-foreign-library Tile
    ;(:darwin (:framework "Tk"))
    (:windows (:or "tile078.dll"))
  (:unix (:or "libtk8.5.so" "libtk.so"))
  (t (:default "libtk")))

<div><p>I modified the foreign library packages as follows to make it work on my machine.&nbsp; In a previous email, someone said it worked best (at least for cello) with tcl 8.5 so we might as well make that explicit on unix.<br><br>(define-foreign-library Tcl<br>
&nbsp;&nbsp;&nbsp; (:darwin (:framework "Tcl"))<br>&nbsp; (:windows (:or "Tcl85.dll"))<br>&nbsp; (:unix (:or "<a href="http://libtcl8.5.so">libtcl8.5.so</a>" "libtcl.so"))<br>&nbsp; (t (:default "libtcl")))<br><br>(define-foreign-library Tk<br>&nbsp;&nbsp;&nbsp; (:darwin (:framework "Tk"))<br>&nbsp; (:windows (:or "Tk85.dll"))<br>&nbsp; (:unix (:or "<a href="http://libtk8.5.so">libtk8.5.so</a>" "libtk.so"))<br>&nbsp; (t (:default "libtk")))<br><br>(define-foreign-library Tile<br>&nbsp;&nbsp;&nbsp; ;(:darwin (:framework "Tk"))<br>&nbsp;&nbsp;&nbsp; (:windows (:or "tile078.dll"))<br>&nbsp; (:unix (:or "<a href="http://libtk8.5.so">libtk8.5.so</a>" "libtk.so"))<br>
&nbsp; (t (:default "libtk")))<br></p></div>
Andy Chambers | 12 Mar 2008 21:36

celtk cleaning - cg package

For those of us unfortunate enough to be doing lisp for free ;-)

..in run.lisp (run-window)

  #+allegro (CG:kill-splash-screen)

I'm assuming here that cg is only found on allegro.  Is that the case?

<div><p>For those of us unfortunate enough to be doing lisp for free ;-)<br><br>..in run.lisp (run-window)<br><br>&nbsp; #+allegro (CG:kill-splash-screen)<br><br>I'm assuming here that cg is only found on allegro.&nbsp; Is that the case?<br></p></div>
Andy Chambers | 15 Mar 2008 11:39

Newbie Friendly Fork of celtk

Hi all,


I've created a project for celtk development on


I'll keep the master branch as a mirror of the celtk in cells (I'll try to work out a way to automate this so it doesn't get out of sync).  I've added another branch (linux) and committed the changes I sent a few days ago.

The intention is that folks here just continue to work as they do.  I take any changes and forward them (in an asdf-friendly way if applicable) to the git repo.  Maybe I'll even add some function documentation.

Its very much an experiment.  I'm pretty new to git and getting a bit more familiar with celtk but I'd still say I'm a little wet behind the ears.  Hopefully I can make it friendly enough that a few others will jump in and help me out.

--
Andy Chambers
<div>
<p>Hi all,</p>
<div><br class="webkit-block-placeholder"></div>
<div>I've created a project for celtk development on</div>
<div><br class="webkit-block-placeholder"></div>
<div><a href="http://repo.or.cz">repo.or.cz</a></div>
<div>
<br class="webkit-block-placeholder">
</div>
<div>I'll keep the master branch as a mirror of the celtk in cells (I'll try to work out a way to&nbsp;automate this so it doesn't get out of sync). &nbsp;I've added another branch (linux) and committed the changes I sent a few days ago.</div>
<div><br class="webkit-block-placeholder"></div>
<div>The intention is that folks here just continue to work as they do. &nbsp;I take any changes and forward them (in an asdf-friendly way if applicable) to the git repo. &nbsp;Maybe I'll even add some function documentation.</div>
<div><br class="webkit-block-placeholder"></div>
<div>Its very much an experiment. &nbsp;I'm pretty new to git and getting a bit more familiar with celtk but I'd still say I'm a little wet behind the ears. &nbsp;Hopefully I can make it friendly enough that a few others will jump in and help me out.</div>
<div><br class="webkit-block-placeholder"></div>
<div>--</div>
<div>Andy Chambers</div>
</div>
Ken Tilton | 15 Mar 2008 12:06
Favicon

Re: Newbie Friendly Fork of celtk

Andy Chambers wrote:
> Hi all,
> 
> I've created a project for celtk development on
> 
> repo.or.cz <http://repo.or.cz>
> 
> I'll keep the master branch as a mirror of the celtk in cells (I'll try 
> to work out a way to automate this so it doesn't get out of sync).  I've 
> added another branch (linux) and committed the changes I sent a few days 
> ago.
> 
> The intention is that folks here just continue to work as they do.  I 
> take any changes and forward them (in an asdf-friendly way if 
> applicable) to the git repo.  Maybe I'll even add some function 
> documentation.
> 
> Its very much an experiment.  I'm pretty new to git and getting a bit 
> more familiar with celtk but I'd still say I'm a little wet behind the 
> ears.  Hopefully I can make it friendly enough that a few others will 
> jump in and help me out.

Cool. But on the repo it says "Linux/SBCL Friendly". Is that literally 
true? An OS/Lisp implementation-specific fork of a portable GUI?

Hmmm... :)

kenny
Ken Tilton | 15 Mar 2008 12:21
Favicon

Re: Newbie Friendly Fork of celtk

Ken Tilton wrote:
> Andy Chambers wrote:
> 
>> Hi all,
>>
>> I've created a project for celtk development on
>>
>> repo.or.cz <http://repo.or.cz>
>>
>> I'll keep the master branch as a mirror of the celtk in cells (I'll 
>> try to work out a way to automate this so it doesn't get out of 
>> sync).  I've added another branch (linux) and committed the changes I 
>> sent a few days ago.
>>
>> The intention is that folks here just continue to work as they do.  I 
>> take any changes and forward them (in an asdf-friendly way if 
>> applicable) to the git repo.  Maybe I'll even add some function 
>> documentation.
>>
>> Its very much an experiment.  I'm pretty new to git and getting a bit 
>> more familiar with celtk but I'd still say I'm a little wet behind the 
>> ears.  Hopefully I can make it friendly enough that a few others will 
>> jump in and help me out.
> 
> 
> Cool. But on the repo it says "Linux/SBCL Friendly". Is that literally 
> true? An OS/Lisp implementation-specific fork of a portable GUI?
> 
> Hmmm... :)

Perhaps I should offer more than Om. :)

A number of people have threatened to do what Peter Denno did for 
Cells-Gtk and fire up a standalone Celtk project (or maybe he accepted 
ownership of the project after I started it -- yes, I think so).

If enough (or one energetic) of those remain perhaps it is time? Then 
you could merge your patches with the main version and keep moving 
towards the light (a portable Lisp GUI).

I would continue committing anything I do to Celtk under the Cells 
repository, mainly because I am too frazzled now to worry about keeping 
Algebra stuff out of other libraries.

kenny
Andy Chambers | 15 Mar 2008 17:06

False Start

So that last one was a false start.  After reading a little bit more about git and how it plays with
cvs, I managed to create another project that keeps all the existing history and puts a nice
user interface on it.

The gitorious hosting seems a little more polished and a bit more newbie friendly (as befits a
newbie friendly project).  I would have used that one first had I known about it but only came
accross it when looking for more info.  Here's the url...

http://gitorious.org/projects/celtk

Kenny, you get the prize for the best commit / commit message ratio :-)

--
Andy


<div><p>So that last one was a false start.&nbsp; After reading a little bit more about git and how it plays with <br>cvs, I managed to create another project that keeps all the existing history and puts a nice<br>user interface on it.<br><br>The gitorious hosting seems a little more polished and a bit more newbie friendly (as befits a<br>newbie friendly project).&nbsp; I would have used that one first had I known about it but only came<br>accross it when looking for more info.&nbsp; Here's the url...<br><br><a href="http://gitorious.org/projects/celtk">http://gitorious.org/projects/celtk</a><br><br>Kenny, you get the prize for the best commit / commit message ratio :-)<br><br>--<br>Andy<br><br><br></p></div>
Ken Tilton | 15 Mar 2008 20:44
Favicon

Re: False Start

Andy Chambers wrote:
> Kenny, you get the prize for the best commit / commit message ratio :-)

Careful, I have a reputation to maintain.

:)

kenny
Andy Chambers | 17 Mar 2008 21:00

expander reinvigorated

Hi Kenny,

I never quite finished that expander stuff when I was doing it before.  I ran
into difficulties with the up/down icons but I think I know how to fix
that now.  However
there seems to be another problem.  If you try evaluate the test-window form at
the bottom, every second time, you get "Tcl Error: out of stack
space".  I think there
must be something that needs to be destroyed somewhere but none of the other
composite widgets seem to have to do that.

Any ideas?

(defmodel expander (frame-stack)
  ((label :initarg :label :accessor label :initform (c-in nil))
   (expansion :initarg :expansion :accessor expansion :initform nil)
   (expanded :initarg :expanded :accessor expanded :initform (c-in nil)))
  (:default-initargs
    :fm-parent (error "expander widget must have some kind of parent")))

(defmacro mk-expander ((&rest inits) &body body)
  `(make-instance 'expander
                  , <at> inits
                  :fm-parent *parent*
                  :expansion (c? (the-kids , <at> body))
                  :expanded (c-in t)
                  :kids (c? (the-kids
                             (mk-button-ex ((^label) (setf (expanded
(upper self expander))
                                                          (not
(expanded (upper self expander))))))
			     (^expansion)))
		  :kids-packing (c? (when (^kids)
				      (if (^expanded)
					  (format nil "pack~{ ~a~} -side top -anchor nw  -padx ~a -pady ~a"
						  (mapcar 'path (^kids))
						  (^padx) (^pady))

					  (format nil "pack forget~{ ~a~}"
						  (mapcar 'path (cdr (^kids)))))))))

(defmodel expander-test (window)
  ()
  (:default-initargs
      :kids (c? (the-kids
		 (mk-stack (:packing (c?pack-self))
		   (mk-expander (:label "hi")
		     (mk-label :text "hi")
		     (mk-label :text "ho")))))))

(test-window 'expander-test)
Andy Chambers | 17 Mar 2008 23:59

observers

Two questions...

1) What's the best way to remove an observer that's been set on some slot?

2) If there's an observer like

(defobserver image-files ((self widget))
  (loop for (name file-pathname) in (set-difference new-value
old-value :key 'car)
      do (tk-format `(:pre-make-tk  ,self)
           "image create photo ~(~a.~a~) -file {~a} -height ~a -width ~a"
           (^path) name (namestring file-pathname)
           (^height)(^width))))

....can I make one that specializes on a subclass of widget that
overrides the first?  How does one do this?

--
Andy

Gmane