From: Ricardo Wurmus <rekado@elephly.net>
To: Lee Thomas <leet22303be@gmail.com>
Cc: tsyesika@tsyesika.se, 57379@debbugs.gnu.org, david@altosw.be
Subject: bug#57379: GUI toolkit for Guile 3.0?
Date: Sat, 27 Aug 2022 10:30:24 +0200 [thread overview]
Message-ID: <871qt2xe0k.fsf@elephly.net> (raw)
In-Reply-To: <CANYin9U9mK44zY17H7EKFkOSeve8GUgCoyQiUutfvqa0drRTPA@mail.gmail.com>
Hi,
Lee Thomas <leet22303be@gmail.com> writes:
> Thank you for responding, Ricardo! I have tried several permutations
> of packages, but currently I have this: […]
This looks all right to me.
I can reproduce this. I also tried the latest commit of g-golf:
guix shell --pure guile \
guile-g-golf \
gtk@4 \
coreutils \
grep \
--with-commit=guile-g-golf=b9956e6e4c60d6be5424290e4366f3d3f46b2c31 \
--cores=1
No difference.
My first guess was that perhaps it gets confused because GTK 3 stuff
also exists on my machine, so I used “--pure” to overwrite the
environment variables. I also tried “--container” to be sure it doesn’t
accidentally pick up incompatible stuff.
But I can’t get it to work. It would be helpful if g-golf were to print
more diagnostic information. As it is I cannot think of anything to
make it work.
I only ever used guile-gi successfully. This is the Guix shell:
guix shell --pure guile guile-gi gtk@4 -- guile gi-test.scm
And here’s the code in gi-test.scm:
--8<---------------cut here---------------start------------->8---
(use-modules (gi) (gi repository))
(require "Gio" "2.0")
(require "Gtk" "4.0")
(load-by-name "Gio" "Application") ;activate, run
(load-by-name "Gtk" "Application")
(load-by-name "Gtk" "ApplicationWindow")
(load-by-name "Gtk" "Button")
(load-by-name "Gtk" "Box")
(load-by-name "Gtk" "Window")
(load-by-name "Gtk" "Widget") ;present
(define (print-hello widget)
(display "Hello World\n"))
(define (on-activate app)
(let* ((window (make <GtkApplicationWindow>
#:application app
#:default-height 200
#:default-width 200
#:title "Window"))
(box (make <GtkBox>))
(button (make <GtkButton>
#:label "Hello world")))
(set-child window box)
(append box button)
(connect button clicked print-hello)
(present window)))
(define (main)
(let ((app (make <GtkApplication> #:application-id "org.gtk.example")))
(connect app activate on-activate)
(run app (command-line))))
(main)
--8<---------------cut here---------------end--------------->8---
Clicking the button prints “Hello World” to the terminal.
--
Ricardo
next prev parent reply other threads:[~2022-08-27 8:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 2:35 bug#57379: GUI toolkit for Guile 3.0? Lee Thomas
2022-08-24 12:29 ` Jessica Tallon
2022-08-24 16:05 ` Lee Thomas
2022-08-24 18:55 ` Jessica Tallon
2022-08-24 20:03 ` David Pirotte
2022-08-24 21:49 ` Lee Thomas
2022-08-26 2:27 ` David Pirotte
2022-08-26 20:03 ` Lee Thomas
2022-08-26 20:35 ` Ricardo Wurmus
2022-08-26 21:11 ` Lee Thomas
2022-08-27 8:30 ` Ricardo Wurmus [this message]
2022-08-28 23:04 ` David Pirotte
2022-08-28 22:42 ` David Pirotte
2022-08-29 2:32 ` Lee Thomas
2022-08-29 9:11 ` Ricardo Wurmus
2022-08-29 9:12 ` Ricardo Wurmus
2022-08-29 16:54 ` David Pirotte
2022-08-29 18:22 ` Lee Thomas
2022-08-29 23:23 ` David Pirotte
2022-08-30 18:33 ` Lee Thomas
2022-09-01 7:17 ` adriano
2022-09-03 4:26 ` David Pirotte
2022-08-29 19:55 ` Ricardo Wurmus
2022-08-30 18:24 ` Lee Thomas
2022-09-03 4:15 ` 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=871qt2xe0k.fsf@elephly.net \
--to=rekado@elephly.net \
--cc=57379@debbugs.gnu.org \
--cc=david@altosw.be \
--cc=leet22303be@gmail.com \
--cc=tsyesika@tsyesika.se \
/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).