unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Vladimir Zhbanov <vzhbanov@gmail.com>
To: guile-user@gnu.org
Subject: Re: G-Golf - Getting started
Date: Mon, 12 Apr 2021 17:33:35 +0300	[thread overview]
Message-ID: <YHRaP50AhUBMa7dk@lepton> (raw)
In-Reply-To: <7f98acdae617d7bd20fa3f8432cd7c087a695673.camel@mrc-lmb.cam.ac.uk>

Hi Paul
On Mon, Apr 12, 2021 at 12:35:58PM +0100, Paul Emsley wrote:
> Hi G-Golfers,
> 
> >From here:
> https://www.gnu.org/software/g-golf/manual/g-golf.html
> 
> 
>    GNU G-Golf can be obtained from the following archive site http://ftp.gnu.org/gnu/g-golf/. The file will
>    be named g-golf-version.tar.gz. The current version is 0.1.0, so the file you should grab is:
> 
>     http://ftp.gnu.org/gnu/g-golf/g-golf-0.1.0.tar.gz 
> 
> This directory does not exist.
> 
> So I used the git repo, built and installed. I extracted the hello-world example (attached)
> 
> $ guile -s example-1.scm  # takes about 7 seconds
> guile -s example-1.scm
> Backtrace:
>            8 (apply-smob/1 #<catch-closure 7f8f920d22a0>)
> In ice-9/boot-9.scm:
>     705:2  7 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
> In ice-9/eval.scm:
>     619:8  6 (_ #(#(#<directory (guile-user) 7f8f91d64140>)))
> In ice-9/boot-9.scm:
>    2312:4  5 (save-module-excursion _)
>   3832:12  4 (_)
> In g-golf/hl-api/function.scm:
>    140:19  3 (_ . _)
> In unknown file:
>            2 (_ #<pointer 0x55f7a37d14f0> #<pointer 0x7f8f8e2147a0> 3 …)
> In g-golf/hl-api/closure.scm:
>     255:8  1 (g-closure-marshal _ _ _ _ _ _)
> In /home/paule/Projects/coot/git/g-golf/build/example-1.scm:
>      14:4  0 (activate _)
> 
> /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?

No, git-grep tells me there is no 'set-child' function in the g-golf repository. 

I've modified the example and it now works as expected, see below:

================================8<================================
;; Load Gtk
(use-modules (g-golf))
(gi-import "Gtk")

;; When the application is launched..
(define (activate app)
  ;; - Create a new window and a new button
  (let ((window (make <gtk-application-window>
                  #:title "Hello"
                  #:application app))
        (button-box (make <gtk-button-box>))
        (button (make <gtk-button>
                  #:label "Hello, World!")))
    ;; - Which closes the window when clicked
    (connect button
             'clicked
             (lambda (b)
               (close window)))
    (gtk-container-add window button-box)
    (gtk-container-add button-box button)
    (show button)
    (show button-box)
    (show window)))

(let ((app (make <gtk-application>
             #:application-id "com.example.GtkApplication")))
  (connect app 'activate activate)
  (run app 0 '()))
================================>8================================

HTH,
  Vladimir



  reply	other threads:[~2021-04-12 14:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12 11:35 G-Golf - Getting started Paul Emsley
2021-04-12 14:33 ` Vladimir Zhbanov [this message]
2021-04-12 16:08 ` David Pirotte

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=YHRaP50AhUBMa7dk@lepton \
    --to=vzhbanov@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).