Re: Re: Core Image

Espen S Johnsen <[email protected]> 18 Apr 2006 11:53:24 +0200
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
ephrem boudonnet <[email protected]> writes:

> Saving an image without initializing clg, it seems there are some
> problems with classes.
> For example, after running the image saved, and calling clg-init,
>  it finds the class om-dialog, but it can't make an instance of it.
> 
> the class om-dialog inherit from gtk::window. But it seems that in the
> image, it is not registered.
> Is there a way to restore the list of new registered types. Because if
> I don't make an image it works.

This is my fault, as I have apparently not tested if saving images with
custom classes work. The function reinitialize-all-types in
glib/gtype.lisp seems to be missing the code to re-register custom types
when the image is loaded. If you replace the current code with the
following, I think it should work:

(defun reinitialize-all-types ()
  (clrhash *lisp-type-to-type-number*)
  (clrhash *type-number-to-lisp-type*)
  (type-init) ; initialize the glib type system
  (mapc #'(lambda (type) 
            (register-type (car type) (cdr type)))
        *registered-types*)
  (mapc #'(lambda (type) 
            (apply #'register-new-type type))
        *registered-static-types*)
  (mapc #'(lambda (type) 
            (register-type-alias (car type) (cdr type)))
        *registered-type-aliases*))

-- 
Espen


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642