From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.user Subject: Re: G-Golf - Getting started Date: Mon, 12 Apr 2021 13:08:04 -0300 Message-ID: <20210412130804.1fcc69d1@aicha> References: <7f98acdae617d7bd20fa3f8432cd7c087a695673.camel@mrc-lmb.cam.ac.uk> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/Ycq5c5WFcOClooHBUU/Q3vD"; protocol="application/pgp-signature"; micalg=pgp-sha512 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36208"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org To: Paul Emsley Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Apr 12 18:08:54 2021 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 1lVz7O-0009JB-2q for guile-user@m.gmane-mx.org; Mon, 12 Apr 2021 18:08:54 +0200 Original-Received: from localhost ([::1]:42986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVz7M-0001nG-U3 for guile-user@m.gmane-mx.org; Mon, 12 Apr 2021 12:08:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVz6x-0001kO-Du for guile-user@gnu.org; Mon, 12 Apr 2021 12:08:27 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:36830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVz6q-000320-Sy for guile-user@gnu.org; Mon, 12 Apr 2021 12:08:26 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 01D0C1BE008B; Mon, 12 Apr 2021 18:08:13 +0200 (CEST) Original-Received: from maximusconfessor.all2all.org ([127.0.0.1]) by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id su7LJchqVY0U; Mon, 12 Apr 2021 18:08:12 +0200 (CEST) Original-Received: from aicha (unknown [179.210.52.91]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id F2FBF1BE0079; Mon, 12 Apr 2021 18:08:11 +0200 (CEST) In-Reply-To: <7f98acdae617d7bd20fa3f8432cd7c087a695673.camel@mrc-lmb.cam.ac.uk> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Received-SPF: pass client-ip=79.99.200.102; envelope-from=david@altosw.be; helo=maximusconfessor.all2all.org X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, 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:17412 Archived-At: --Sig_/Ycq5c5WFcOClooHBUU/Q3vD Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello Paul, > From here: > https://www.gnu.org/software/g-golf/manual/g-golf.html There is no G-Golf release yet - it is mentioned on the web-site, both the home page and in the install page ... but not in the manual indeed, didn't want to ... > $ guile -s example-1.scm # takes about 7 seconds > guile -s example-1.scm Please read the Getting Started with G-Golf, Selective Import ... you are importing the entire Gtk namespace - here, fwiw, if I do that, it takes 2sec, so mileage varies depending on the machine, mem ...=20 > Backtrace: > ... > /home/paule/Projects/coot/git/g-golf/build/example-1.scm:14:4: In > procedure activate: In procedure module-lookup: Unbound variable: > set-child > Have I done something wrong? Yes :) you copied and run an example which is for Gtk-4.0, but loading Gtk-3.0 ... In the manual, 'Getting Started with G-Golf': "Please note that in the entire course of the G-Golf manual, unless otherwise specified, examples are based on and use Gtk-4.0, Gdk-4.0 and Gsk-4.0 - which is new and only available with Gtk-4.0." Below, an example for Gtk-3.0 ... David ;; below, ;; a hello-world example for GTk-3.0 #! /bin/sh # -*- mode: scheme; coding: utf-8 -*- exec guile -e main -s "$0" "$@" !# (eval-when (expand load eval) (use-modules (oop goops)) =20 (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last)) (use-modules (g-golf)) (for-each (lambda (name) (gi-import-by-name "Gtk" name #:version "3.0")) '("Application" "ApplicationWindow" "Box" "Label" "Button"))) (define (activate app) (let ((window (make #:title "Hello" #:default-width 320 #:default-height 240 #:application app)) (box (make #:margin-top 6 #:margin-start 12 #:margin-bottom 6 #:margin-end 6 #:orientation 'vertical)) (label (make #:label "Hello, World!")) (button (make #:label "Close"))) (connect button 'clicked (lambda (b) (close window))) (add window box) (pack-start box label #t #t 0) (pack-start box button #f #f 6) (show-all window))) (define (main args) (let ((app (make #:application-id "org.gnu.tests"))) (connect app 'activate activate) (run app (length args) args))) --Sig_/Ycq5c5WFcOClooHBUU/Q3vD Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmB0cGUACgkQ83T9k6MF etebBAgAxxX+cQ+/g9SRFl7FZGx6SOhSdbE+J5GZwMBOdyLnRAloGhl2AyHvuiYM CM7YTiK8+F8FIVbIhlsSgYtAU6gR9Wf7ALbBpDWmku3MRyMpDlXS7OfQeEdtXSLi c/KUBQsZFFZ0TqbhX7lSEtfdq7wkD8vIljE3YEm/Ee3LzBmuSlG0gYN6sB896i3x yHAVNwLW7tan2lOMcgZgfPv88Zz7pXcRVwv1bHOlVejQ+1AeOeFh9b770AyyoAr+ HA5PnOY7+ni/rzfafj6hMTaTPMLm76xlpThSm+k/hlVJ/Z9BpYc6vYKv8KtavQbL 4W5vCmFQ5I26LV7Hg7si77Di3eGU/w== =BcId -----END PGP SIGNATURE----- --Sig_/Ycq5c5WFcOClooHBUU/Q3vD--