File: filesel.scm

package info (click to toggle)
gauche-gtk 0.6%2Bgit20160927-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,452 kB
  • sloc: ansic: 7,097; lisp: 5,659; sh: 2,829; makefile: 338
file content (22 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;;
;; Simple example, ported from the one in Gtk+2.0 tutorial.
;;
;; $Id: filesel.scm,v 1.2 2007/01/13 01:36:30 maruska Exp $

(use gtk)

(define (main args)
  (gtk-init args)
  (let1 filew (gtk-file-selection-new "File selection")
    (g-signal-connect filew "destroy" (lambda _ (gtk-main-quit)))
    (g-signal-connect (slot-ref filew 'ok-button)
                      "clicked" (lambda (w)
                                  (format #t "~a\n" (gtk-file-selection-get-filename filew))))
    (gtk-file-selection-set-filename filew "penguin.png")
    (gtk-widget-show filew)
    )
  (gtk-main)
  0)