This is the mail archive of the guile-gtk@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gtk-clist-append does not work with shared substrings


"Greg J. Badros" <gjb@cs.washington.edu> writes:

> Whereas this works:
> ;; (gtk-clist-append clist (list "foo" "bar"))
> 
> This does not:
> 
> ;; (gtk-clist-append clist (list (make-shared-substring "foo") "bar"))

Hmm, I get:

    guile> (use-modules (gtk gtk))
    guile> (define clist (gtk-clist-new 2))
    guile> (gtk-clist-append clist (list "foo" "bar"))
    0
    guile> (gtk-clist-append clist (list (make-shared-substring "foo") "bar"))
    1
    guile>

Maybe I'm using the wrong Guile version.  Shared substrings should be
converted to normal strings via the `sgtk_string_conversion' function.
It has this definition:

    SCM
    sgtk_string_conversion (SCM str)
    {
      if (SCM_NIMP (str) && SCM_STRINGP (str))
        SCM_COERCE_SUBSTR (str);
      return str;
    }

There is likely something wrong with the way conversions are handled
for composite types, like the list you are using.

> Also, I don't think there's any way to tell which version of guile-gtk
> you're linked against.  `guile-gtk-version' is a nice primitive to add.

There is the (gtk config) module which contains config information.
It even has a `gtkconf-version' entry but that reflects the version of
Gtk+ that this guile-gtk is build for.  I think we should change that
to be the guile-gtk version and add explicit support for the Gtk+
version in use.  This should come from (gtk dynlink) as that module
knows which library has been dynlinked (guile-gtk-1.2 or
guile-gtk-1.3).  Ariel?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]