[Fwd: Re: [cells-gtk-devel] UTF-8 support]

Dmitri Hrapof hrapof at common-lisp.ru
Thu Jan 17 12:45:47 UTC 2008


Peter Hildebrandt wrote:

> Not for me -- It looks like I can't pass the result of
> string-to-octets where a :gtk-string is expected, for example: (*b* is
> the result of mk-button)
>
> (gtk-button-set-label (id *b*) (sto "s"))
> The value of STRING is #(115), which is not of type STRING.
>    [Condition of type SIMPLE-TYPE-ERROR]
>
> What else do I need to use the result of sto in gtk api calls?
Hm, strange... I do not remember doing anything else...

Who exactly is complaining about type mismatch?
gtk-button-set-label expects :gtk-string, and :gtk-string is :pointer,
not a Lisp string...

(defmethod cffi:translate-to-foreign (value (type (eql
:gtk-string)))          
  (when (null value) (setf value "")) ; pod
???                                
  (cffi:foreign-string-alloc value))

"The |foreign-string-alloc| function allocates a foreign string
containing a Lisp string or |(unsigned-byte 8)| array."

Sincerely yours,
Dmitri






More information about the cells-gtk-devel mailing list