~ubuntu-branches/ubuntu/trusty/guile-gnome-platform/trusty-proposed

« back to all changes in this revision

Viewing changes to gtk/examples/scribble.scm

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Rottmann
  • Date: 2009-03-01 22:51:48 UTC
  • mfrom: (1.1.2 upstream) (3.2.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090301225148-5cubt342wiv8jpmf
Tags: 2.16.1-1
* New upstream release.
* Upstream bumped API, hence all package names changed from
  guile-gnome0-* to guile-gnome2-*.
* Standards-Version 3.8.0 (no changes).
* Remove unused guile-gnome2-cairo.install file.
* Added ${misc:Depends} to all packages.
* Do not build-depend on a -1 revision of the g-wrap packages.
* Add a proper "Copyright YEARS AUTHORS" line to debian/copyright.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
 
exec guile-gnome-0 -s $0 "$@"
 
2
# -*- scheme -*-
 
3
exec guile-gnome-2 -s $0 "$@"
3
4
!#
4
5
;;;A translation of the GTK scribble example
5
6
;;;It features a resizable canvas that can be drawn on with the mouse
7
8
;;;translated to the guile-gnome API by Andy Wingo
8
9
;;;(C) 2004 GNU GPL
9
10
 
10
 
(use-modules (gnome gtk) (gnome gtk gdk-event))
 
11
(use-modules (oop goops) (gnome glib) (gnome gtk) (gnome gtk gdk-event))
11
12
 
12
13
;Variables holding the size of the pixmap & drawing area.
13
14
(define width 200)
39
40
        (a (get-allocation drawing-area)))
40
41
    (set! width (vector-ref a 2))
41
42
    (set! height (vector-ref a 3))
42
 
    (set! pixmap (gdk-pixmap-new window width height))
 
43
    (set! pixmap (gdk-pixmap-new window width height -1))
43
44
    (gdk-draw-rectangle pixmap back-gc 1 0 0 width height))
44
45
  (update-handler))
45
46
;Important note: we can't draw directly on the drawing area.