Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- # -*- scheme -*-
- exec guile-gnome-2 --debug -s $0 "$@"
- !#
- (use-modules (oop goops) (gnome gobject) (gnome gtk))
- ;; deriving from <gobject>
- (define-class <test> (<gobject>)
- ;; a normal object slot
- my-data
- ;; an object slot exported as a gobject property
- (pub-data #:gparam (list <gparam-long> #:name 'test))
- ;; likewise, using non-default parameter settings
- (foo-data #:gparam (list <gparam-long> #:name 'foo
- #:minimum -3 #:maximum 1000
- #:default-value 42))
- ;; a signal with no arguments and no return value
- #:gsignal '(frobate #f)
- ;; a signal with arguments and a return value
- #:gsignal (list 'frobite #f <gint> <glong>))
- (define (main)
- (let ((test (make <test>)))
- (connect test 'frobate (lambda (o) (format #t "yay\n")))
- (emit test 'frobate)
- (connect test 'frobite (lambda (o x y) (format #t "yay: (~a, ~a)\n" x y)))
- (emit test 'frobite (make <gint> #:value 0) (make <glong> #:value 1))))
- (main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement