Advertisement
Guest User

Untitled

a guest
Apr 4th, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #! /bin/sh
  2. # -*- scheme -*-
  3. exec guile-gnome-2 --debug -s $0 "$@"
  4. !#
  5.  
  6. (use-modules (oop goops) (gnome gobject) (gnome gtk))
  7.  
  8. ;; deriving from <gobject>
  9. (define-class <test> (<gobject>)
  10. ;; a normal object slot
  11. my-data
  12.  
  13. ;; an object slot exported as a gobject property
  14. (pub-data #:gparam (list <gparam-long> #:name 'test))
  15.  
  16. ;; likewise, using non-default parameter settings
  17. (foo-data #:gparam (list <gparam-long> #:name 'foo
  18. #:minimum -3 #:maximum 1000
  19. #:default-value 42))
  20.  
  21. ;; a signal with no arguments and no return value
  22. #:gsignal '(frobate #f)
  23.  
  24. ;; a signal with arguments and a return value
  25. #:gsignal (list 'frobite #f <gint> <glong>))
  26.  
  27. (define (main)
  28. (let ((test (make <test>)))
  29. (connect test 'frobate (lambda (o) (format #t "yay\n")))
  30. (emit test 'frobate)
  31. (connect test 'frobite (lambda (o x y) (format #t "yay: (~a, ~a)\n" x y)))
  32. (emit test 'frobite (make <gint> #:value 0) (make <glong> #:value 1))))
  33.  
  34. (main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement