#!@GUILE@ -s !# ;; hello.scm ;; Copyright (C) 2017-2019 Michael Rosset ;; This file is part of giqt ;; giqt is free software: you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by the ;; Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; giqt is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ;; See the GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License along ;; with this program. If not, see . (eval-when (expand load eval) (use-modules (g-golf)) (gi-import "Qt") (map (match-lambda ((namespace item) (gi-import-by-name namespace item))) '(("Gtk" "Widget") ("Gtk" "init") ("Gtk" "main")))) ;; FIXME: gtk-init should not be needed (gtk-init 0 #f) (let ((app (make #:application-id "org.examples.scheme")) (window (make )) (line-edit (make )) (label (make #:label "Hello GNU! from scheme")) (view (make )) (button (make ))) (add window view) (add window label) (add window button) (add window line-edit) (load-uri view "https://gnu.org") (grab-focus line-edit) (g-idle-add (lambda () (gtk-widget-show-all window) #f)) (run app 0 #f))