all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob d262e53cdb4aca889289ebf957aef1e4ca2fbcf9 1957 bytes (raw)
name: test/browser.scm 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
;; Copyright (C) 2019  Michael L. Gran
;; Copyright (C) 2019  Jan (janneke) Nieuwenhuizen <janneke@gnu.org>

;; This program 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.

;; This program 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 <https:;;www.gnu.org/licenses/>.
(use-modules (gi))

(typelib-load "Gio" "2.0")
(typelib-load "Gtk" "3.0")
(typelib-load "GLib" "2.0")
(typelib-load "WebKit2" "4.0")

(define (print-hello widget data)
  (display "Hello World\n"))

(define (activate app user-data)
  (let ((window (cast (ApplicationWindow-new app) <GtkApplicationWindow>))
        (vbox (cast (VBox-new 0 0) <GtkVBox>))
        (browser (cast (WebView-new) <WebKitWebView>))
        (button-box (cast (ButtonBox-new 0) <GtkButtonBox>))
        (button (Button-new-with-label "Hello World")))
    (send window (set-title "Window"))
    (send window (set-default-size 200 200))
    (send window (show-all))
    (send window (add vbox))
    (send vbox (add browser))
    (send vbox (add button-box))

    (connect button (clicked print-hello #f))
    (connect button (clicked (lambda x
                               (send window (destroy)))
                             #f))
    (send browser (load-uri "http://gnu.org/s/mes"))
    (send button-box (add button))
    (send window (show-all))))

(define (main)
  (let ((app (Application-new "org.gtk.example" 0)))
    (connect app (activate activate #f))
    (send app (run (length (command-line)) (command-line)))))

(main)

debug log:

solving d262e53 ...
found d262e53 in https://yhetil.org/guix/874l59smoy.fsf@gnu.org/

applying [1/1] https://yhetil.org/guix/874l59smoy.fsf@gnu.org/
diff --git a/test/browser.scm b/test/browser.scm
new file mode 100644
index 0000000..d262e53

Checking patch test/browser.scm...
Applied patch test/browser.scm cleanly.

index at:
100644 d262e53cdb4aca889289ebf957aef1e4ca2fbcf9	test/browser.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.