help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting up a development environment for guile-g-golf based software


From: Luis Felipe
Subject: Re: Setting up a development environment for guile-g-golf based software in KDE
Date: Fri, 02 Sep 2022 18:30:23 +0000

Hi Jérémy,


On Friday, September 2nd, 2022 at 10:25, Jérémy Korwin-Zmijowski 
<jeremy@korwin-zmijowski.fr> wrote:

> Dear Guixters,
> 

> I want to build a GUI for Gnome (using guile-g-golf (and gtk)).
> 

> When under Gnome my small "Hello World" (from the manual example script)
> window shows up.
> 

> When under KDE (Plasma) nothing shows up but errors in the terminal :

In my case (guix 16a6cbe), the example doesn't work at all, regardless of the 
desktop environment or whether I use a pure environment or container without 
grafts.

I wonder if g-golf really works with GTK 4 (the guix package depends on gtk+, 
which is GTK+ 3)? It's a similar situation with guile-gi...

Also, the "Hello World" example in the documentation is written usin GTK+ API 
as far as I can see. For example, it uses GtkWidget.show(), which was removed 
in GTK 4, as far as I know, because widgets now show themselves by default.

I see that I can launch the program in a pure environment or container if I add 
gtk+ instead gtk. So, given the following program

;; 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 (make <gtk-button>
                  #:label "Hello, World!")))
    ;; - Which closes the window when clicked
    (connect button
             'clicked
             (lambda (b)
               (close window)))
    ;; (set-child window button)  ; FIXME: Unbound variable: set-child
    (show window)))

;; Create a new application
(let ((app (make <gtk-application>
             #:application-id "org.example.GtkApplication")))
  (connect app 'activate activate)
  ;; Run the application
  (run app 0 '()))

I run it as Ricardo indicates

  guix shell --pure --no-grafts guile gtk+ guile-g-golf

and it works. Although I see this warning:

(guile:2): dbind-WARNING **: 18:16:30.514: Couldn't connect to accessibility 
bus: Failed to connect to socket /tmp/dbus-hqCQ04xgN8: No such file or directory

Anyways, just my 2¢ :)

Attachment: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]