unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: Guile User <guile-user@gnu.org>
Subject: Re: getting to know the FFI ...
Date: Sun, 22 Nov 2020 06:55:17 -0800	[thread overview]
Message-ID: <a6bff7bf-0c92-1a59-7588-4d0afce3a4c3@gmail.com> (raw)
In-Reply-To: <CACgrOxJZKxE4eL9keY5HBmqnT9yA22VOrq3Hn2RLd=BsE2PJgQ@mail.gmail.com>



On 11/19/20 7:02 PM, Tim Meehan wrote:
> I figured that I would try and do something simple-ish to see how well I
> understood the FFI. I found this GTK tutorial, written in Chez Scheme:
> https://github.com/jhidding/lyonesse/blob/master/gtk-tutorial/window.scm
> I just tried to replace the Chez FFI calls with Guile FFI calls.
>
> I'm not sure how to tell GTK about a callback that is written in Guile.
> I'm not sure how to pass a string to GTK ...
>
> Cheers,

> ;; HELP: This obviously won't work.
> ;; How would I give GTK a Guile callback?
> (define (callback p)
>      (let ([code (foreign-callable p (iptr iptr) void)])
>          (lock-object code)
>          (foreign-callable-entry-point code)))
try reading the manual section on procedure->pointer




      parent reply	other threads:[~2020-11-22 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  3:02 getting to know the FFI Tim Meehan
2020-11-21 10:19 ` randomlooser
2020-11-22 14:55 ` Matt Wette [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6bff7bf-0c92-1a59-7588-4d0afce3a4c3@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).