[cells-gtk-devel] Re: Hacking the gtk-ffi

Andy Chambers achambers.home at googlemail.com
Mon Oct 29 10:58:45 UTC 2007


On 10/29/07, Ken Tilton <kennytilton at optonline.net> wrote:
> Andy Chambers wrote:
> > On 10/29/07, Andy Chambers <achambers.home at googlemail.com> wrote:

> > OK.  I think I know why its not working.  The ffi call never gets made
> > because cells only uses it if either the new or old value is not nil.
>
> Properties are propagated from the Lisp model to Gtk by "observers" on a
> slot. Celtk and Cells-Gtk generate these observers as part of the
> macroexpansion of the def<i forget> macro to which it seems you
> correctly added the slot. It should not matter that the value (as you
> imply) never changes, because Cells understands that an initial
> propagation is necessary so observers and observed start out in synch.
>
> You can check that you see an observer in the macroexpansion, then that
> that is being called. If not, I would have a concern that Cells-Gtk has
> not been upgraded to use the latest version of Cells, because I have a
> faint recollection that possibly older versions do not propagate a nil
> initial value. I would be shocked if it did not propagate a non-nil
> value, so one thing you might try as a sanity check is to specify a
> non-nil just to see if anything fires.

The observer is being created in the macro-expansion.  That's how I knew to
add the ffi definition (how cool is it that the software knew what function it
needed to call before I did :-)).

My immediate problem is fixed by overriding the generated observer to always
propagate the value so I think you're spot on about cells-gtk not
using the latest cells but I'm starting to have some fun now and feel
a lot more confident about trying to upgrade.

Cheers,
Andy



More information about the cells-gtk-devel mailing list