guile-gtk-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: completion on guile-gnome symbols


From: Andy Wingo
Subject: Re: completion on guile-gnome symbols
Date: Thu, 24 Jul 2008 12:46:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Hi,

On Mon 21 Jul 2008 14:27, "Neil Jerram" <address@hidden> writes:

> 2008/7/18 Andre Kuehne <address@hidden>:
>>
>> is there a way to get completion on all guile-gnome-* symbols?
>
> +1.  I've had exactly this problem in the past too.

Sorry for the late reply. I agree this is the suck.

Late-bound variables are stored in a hash, %gw-latent-variables-hash.
The classes are stored in the g-wrap modules corresponding to the
wrapsets, and the generics are stored in (gnome gw generics) -- there
are some docs about this general strategy in guile-gnome-glib's docs.

To force creation of all of those variables, just reference them in the
modules. So for example to programmatically force creation of all
symbols in some modules, try this:

(define (force-bindings . modules)
  (for-each
   (lambda (sym)
     (let ((mod (resolve-module `(gnome gw ,sym))))
       (for-each
        (lambda (k)
          (module-ref (module-public-interface mod) k))
        ;; copy list of syms because the module binder mutates the hash
        (hash-map->list
         (lambda (k v) k)
         (module-ref mod '%gw-latent-variables-hash)))))
   modules))

;; use like this
(force-bindings 'generics 'gtk)

But obviously that's not the best solution. Do you have a better
suggestion? I'd be happy to include something like that in Guile-GNOME.

Cheers,

Andy
-- 
http://wingolog.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]