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: gdk-pixmap-create-from-file problem


Janis Dzerins <jonis@mt.lv> writes:

> I stuck on the problem with gdk-pixmap-create-from-file: when I try to
> load a pixmap using
> 
> (gdk-pixmap-create-from-file window #f #f "foo.xpm")
> 
> guile-gtk says that 2nd argument (#f) is wrong.  I think this
> procedure should accept #f (NULL) for the mask.

Hmm, yes, but not in the way you hvae done it below.  The `mask'
argument is not a pointer to a GdkBitmap, it is a pointer to a pointer
to a GdkBitmap.  The way this is reflected in Scheme is that `mask' is
a list or vector of length one, and after the function returns, the
list (or vector) has been modified and contains the GdkBitmap.

However, it should be possible to pass `#f', indicating that one isn't
interested in the mask bitmap.  The machinery in guile-gtk did not
allow this, but I have now pacthed it so that the mask parameter is
declared as
 
    ((ret GdkWindow) mask (null-ok))

That is, with a recent guile-gtk from CVS you can use

    (gdk-pixmap-create-from-file window #f #f "foo.xpm")

and it will work.

If you always use `#f' for `mask', your version is also safe, but
still incorrect.  Please use guile-gtk from CVS, if you can.

- Marius

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