chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Define-external error


From: William Ramsay
Subject: Re: [Chicken-users] Define-external error
Date: Mon, 07 May 2007 07:35:53 -0400
User-agent: Thunderbird 1.5.0.10 (X11/20070221)

This is basically the code I am using:

#>?
int g_signal_connect(void *, char *, void *, void *);
<#

(define-external (setColor ((pointer "GtkWidget") widget)
                  (c-pointer num))
  void
  (printf "num = ~A~%" num))

....
  (let
     ((cbut (gtk_color_button_new_with_color "#ffffff")))
....
     (g_signal_connect cbut "color-set" #$setColor ????? )

The question is what do I put where the ????? are? The Gtk docs state that the "color-set" signal will return the widget that called the signal and "user data" as a gpointer. No matter what I try I get a "not a pointer error" - including (make-locative x) which bombed when I tried to reference it with (locative-ref ..). You must be able to do this, I just don't know how. (I have a workaround, but I would still like to know how this is supposed to work).

Bill

felix winkelmann wrote:
On 5/1/07, William Ramsay <address@hidden> wrote:
Hi,

I don't know if this is a Ramsay, a Chicken, an easyFF, or a GTK error,
but I get the following when I use g_signal_connect, which is supposed
to call back to Scheme when a button is pressed.

The command     (g_signal_connect button "color-set" #$setColor 1)

Should call back to:   (define-external (setColor ((pointer
"GtkColorButton") widget)

           (c-pointer data))
                                      void
                                      (printf "got data = ~A~%" data) )

But it gives me a type error:

Error: (location) bad argument type - locative can not refer to objects
of this type: #<procedure (setColor widget1371 data1372)>


Does the callback definition appear textually after the g_signal_connect
call? Can you send me the source file?


cheers,
felix





reply via email to

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