File: simple.scm

package info (click to toggle)
guile-gtk-1.2 0.31-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,544 kB
  • ctags: 2,413
  • sloc: sh: 11,073; ansic: 3,380; lisp: 1,058; makefile: 106
file content (25 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (5)
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
(use-modules (gtk gtk))

(read-set! keywords 'prefix)

(let* ((window (gtk-widget-new 'GtkWindow
			       :type         'toplevel
			       :title        "hello world"
			       :allow_grow   #f
			       :allow_shrink #f
			       :GtkContainer::border_width 10))
       (label  (gtk-widget-new 'GtkLabel
			       :label        "hello world"
			       :visible      #t))
       (button (gtk-widget-new 'GtkButton
			       :child        label
			       :parent       window
			       :visible      #t)))

  (gtk-signal-connect button "clicked" 
		      (lambda ()
			(display (gtk-object-get label :label))
			(newline)
			(gtk-widget-set label :label "yo!")))
  (gtk-widget-show window)
  (gtk-standalone-main window))