source: trunk/third/rep-gtk/examples/canvas-test @ 18404

Revision 18404, 1.2 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18403, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2exec rep "$0" "$@"
3!#
4
5(require 'gui.gtk-2.gtk)
6(require 'gui.gtk-2.gnome-ui)
7(require 'gui.gtk-2.gnome-canvas)
8
9(let*
10    ((app (gnome-app-new "canvas-test" "canvas-test"))
11     (frame (gtk-frame-new "Canvas"))
12     (canvas (gnome-canvas-new)))
13
14  (gtk-widget-set-usize canvas 400 400)
15  (gnome-canvas-set-scroll-region canvas 0 0 400 400)
16
17  (gnome-canvas-item-new (gnome-canvas-root canvas)
18                         'GnomeCanvasRect
19                         (list 'x1 10 'y1 10
20                               'x2 200 'y2 200
21                               'fill_color "tan"
22                               'outline_color "blue"))
23
24  (gnome-canvas-item-new (gnome-canvas-root canvas)
25                         'GnomeCanvasEllipse
26                         (list 'x1 50 'y1 50
27                               'x2 150 'y2 150
28                               'outline_color "black"
29                               'fill_color "mediumseagreen"))
30
31;  (gnome-canvas-item-new (gnome-canvas-root canvas)
32;                        'GnomeCanvasLine
33;                        (list 'points '(150 150
34;                                        250 150
35;                                        250 250
36;                                        150 250)))
37
38  (gnome-canvas-item-new (gnome-canvas-root canvas)
39                         'GnomeCanvasText
40                         (list 'x 100 'y 100 'text "hello, world"
41                               'font "fixed"))
42
43  (gtk-container-add frame canvas)
44  (gnome-app-set-contents app frame)
45  (gtk-widget-show-all app)
46
47  (g-signal-connect app "delete_event" (lambda () (throw 'quit 0)))
48
49  (setq interrupt-mode 'exit)
50  (recursive-edit))
51 
Note: See TracBrowser for help on using the repository browser.