From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: getting to know the FFI ... Date: Sun, 22 Nov 2020 06:55:17 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19111"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Nov 22 15:55:37 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kgqm8-0004pm-KA for guile-user@m.gmane-mx.org; Sun, 22 Nov 2020 15:55:36 +0100 Original-Received: from localhost ([::1]:39768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgqm7-0007U6-G9 for guile-user@m.gmane-mx.org; Sun, 22 Nov 2020 09:55:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgqlv-0007Tr-1i for guile-user@gnu.org; Sun, 22 Nov 2020 09:55:23 -0500 Original-Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:33139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgqlt-0005PP-Hc for guile-user@gnu.org; Sun, 22 Nov 2020 09:55:22 -0500 Original-Received: by mail-pl1-x634.google.com with SMTP id t18so7548444plo.0 for ; Sun, 22 Nov 2020 06:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=oIJylVkeEODaQjxgaE5J7pqAA87YjeVWHtGPyTk7HJ0=; b=fvjcleYTA0YQh+mzBm+b/iV/y1FyDqcjVwCatAmkwGeDRxfX+NKqdkmWUCWl8OslSk 7FgVq4XYFbwR3oElmCX0B6r7sA8zC6sQ2QkviOCHxB0FRkDnH0XFq4NIWJHYxyhw4mQI Qq36Lj1vX3k4w8IAaxr3rKNMRE3nnHMP2ScpyLRpWQzrEfGAmaM0iU9w8FYutlrveMyu D3VasucwBbD97qIMn92whtF14Gi+w0Z1JCZixyk+YkuIv8gJbtsn6ITvFI7W5Ods+t7Y 2+eRn/GYeoyLIJEp0bqwyiiIrgjyn3MOlt8nrO7Whd2K/ikArlZFcFKSfz4mMNoauD8H SrLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=oIJylVkeEODaQjxgaE5J7pqAA87YjeVWHtGPyTk7HJ0=; b=Ct4EwVU/OD9YIFt6eRfQAbhTtjdhu0ZumATaGPQpFDbm31rLIYWnRVL4Vyl8QtH7Ib E1T2eLTXcTF8me5Dt9NlA64vKBTEMYbt0q/q2l5mdZ73XGao2zKYvJgYeTkFGw6TBLNY Wi8YtyStEGSxNtVtITTtfITeTKQk3h3wyukcfRbJ6A3q0IufpNTHLtDn9aePE3ywcGBH pyUIeDNSY9A5e9l5sZ7Mf8HX0g8nUDyecmdCC74AbJ5tYlbIOeXgUzVJMvZxwYmVcL30 JL7FxiYXFtfNH6XfJLCCtwV3lreLERzAvr48jyGW8FOyRHEpwzI+iir1YApWTUv83rFB MZ1Q== X-Gm-Message-State: AOAM533kTct2FLRtaiy/nKVaWmQbnCI8tWy//Ehzo6pmiJzPQtDOuwBR edY0+fr3JQNAucqFYcSdooByEpuHjgs= X-Google-Smtp-Source: ABdhPJxpW73h9Vi1ITruynRyLtXJ5wU3r51buxHwoWk+nZo8xQCZUPXqb358SiyDCbKep8QN2De9aw== X-Received: by 2002:a17:902:221:b029:d8:f938:b112 with SMTP id 30-20020a1709020221b02900d8f938b112mr20531889plc.10.1606056919185; Sun, 22 Nov 2020 06:55:19 -0800 (PST) Original-Received: from [192.168.2.183] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id z128sm8430139pgz.69.2020.11.22.06.55.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2020 06:55:18 -0800 (PST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=matt.wette@gmail.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17033 Archived-At: 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