chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] setting a callback in xlib


From: Eduardo Cavazos
Subject: Re: [Chicken-users] setting a callback in xlib
Date: Sat, 07 Mar 2009 16:24:08 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080716 SeaMonkey/1.1.11


Eduardo Cavazos <address@hidden> wrote:

Here's how I'm defining 'XSetErrorHandler' on the Chicken side:

(define XSetErrorHandler
 (foreign-safe-lambda c-pointer XSetErrorHandler
   (function int (c-pointer c-pointer))))

And finally, a test error handler:

(define-external (xerrorhandler (c-pointer dpy) (c-pointer ev)) int
 (display "Error handler called\n"))

If I trigger an X error, I get a pretty wacky error:

   Error: bad argument count - received 134902918 but expected 2: #()

felix winkelmann wrote:

How do you invoke XSetErrorHandler?

In this particular case, like this:

    (XSetErrorHandler xerrorhandler)

But ideally, the API should work such that you can do flexible stuff like:

    (XSetErrorHandler (lambda (dpy ev) ...))

I.e. pass arbitrary callbacks at runtime.

Ed




reply via email to

[Prev in Thread] Current Thread [Next in Thread]