Re: pixmap-new

Espen S Johnsen <[email protected]> 29 May 2006 10:25:24 +0200
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
ephrem boudonnet <[email protected]> writes:

> Hi Espen,
> 
> I'm trying to use the function pixmap-new like this:
>  (gdk::pixmap-new 10 10 1 :window (gdk::%get-default-root-window))
> or
>  (gdk::pixmap-new 10 10 -1 :window (gdk::%get-default-root-window))
> 
> And I've got a memory fault.
> 
> Am I doing something wrong?

Not really, but you don't need to specify the window argument as
the root window is the default. I would also recommend that you pixbufs
instead of pixmaps, except when you need to create an offscreen drawable.

The memory fault is caused by arguments having wrong order in the
foreign function call. The correct definition of pixmap-new should be:

(defbinding pixmap-new (width height depth &key window) pixmap
  (window (or null window))
  (width int)
  (height int)
  (depth int))

-- 
Espen