This is the mail archive of the
guile-gtk@sourceware.cygnus.com
mailing list for the Guile project.
Re: gdk-pixmap-create-from-file problem
- To: Janis Dzerins <jonis at mt dot lv>
- Subject: Re: gdk-pixmap-create-from-file problem
- From: Marius Vollmer <mvo at zagadka dot ping dot de>
- Date: 29 Jan 2000 14:55:11 +0100
- Cc: guile-gtk at sourceware dot cygnus dot com
- References: <Pine.LNX.4.10.10001261002470.11811-100000@goo.dev.mt.lv>
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