[cells-gtk-devel] gtk first app

Johan Ur Riise johan at riise-data.no
Fri Jan 16 22:39:45 UTC 2009


fr., 16.01.2009 kl. 20.07 +0000, skrev Martin Kielhorn:

> I can work quite good with cells-gtk now (on a 32bit linux and under
> 64bit ubuntu).
> 
> I think I fixed the error you are describing. (last time I wrote
> I resolved the issue by changing  the following lines in
> gtk-ffi/gtk-ffi-impl.lisp (I removed the extra code for sbcl by
> renaming #+sbcl to #+sbcl2):
> 
>  (defun lisp-to-utf-8 (str)
>   #-(or clisp sbcl2) (return-from lisp-to-utf-8 str)
>   (when str
>     #+clisp (ext:convert-string-to-bytes str charset:utf-8)
>     #+sbcl2 (sb-ext:string-to-octets str :external-format :utf-8)))
> 
> (defun utf-8-to-lisp (str)
>   #-(or clisp sbcl2) (return-from utf-8-to-lisp str)
>   (when str
>     (let* ((nat (lisp-to-utf-8 str))
>            (oct (coerce (loop for i from 0 below (length nat)
>                            for b = (aref nat i)
>                            collect b
>                            ;; ph: gtk gives us 4 bytes per char ;
> why ?
>                            if (= b 195) do (incf i 2))
>                         '(vector (unsigned-byte 8)))))
>       #+clisp (ext:convert-string-from-bytes oct charset:utf-8)
>       #+sbcl2  (sb-ext:octets-to-string
> oct :external-format :utf-8))))
> )

This worked, thanks. Looks like the functions now effectively returns
the input string. If this is a permanent fix, maybe it should go into
cvs?
        
I now have my first app going (an empty window with a name) and it even
stops when I kill the window, which was my second goal(!).
        
        






More information about the cells-gtk-devel mailing list