[cairo-commit] pycairo/examples/gtk cairo-demo.py, 1.3,
1.4 cairo-knockout.py, 1.4, 1.5 hangman.py, 1.4,
1.5 lsystem.py, 1.3, 1.4 png_view.py, 1.5, 1.6 text.py, 1.4, 1.5
Steve Chaplin
commit at pdx.freedesktop.org
Sun May 8 17:52:49 PDT 2005
- Previous message: [cairo-commit]
pycairo/cairo pycairo-private.h, 1.19, 1.20 pycairo.h,
1.26, 1.27 cairomodule.c, 1.29, 1.30 cairogtkmodule.c, 1.17,
1.18 pycairo-pattern.c, 1.16, 1.17 pycairo-matrix.c, 1.13,
1.14 pycairo-context.c, 1.45, 1.46 pycairo-surface.c, 1.33,
1.34 pycairo-font.c, 1.12, 1.13
- Next message: [cairo-commit] pycairo ChangeLog, 1.105, 1.106 AUTHORS, 1.2,
1.3 NEWS, 1.8, 1.9 NOTES, 1.3, 1.4 pycairo.pc.in, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: stevech1097
Update of /cvs/cairo/pycairo/examples/gtk
In directory gabe:/tmp/cvs-serv27558/examples/gtk
Modified Files:
cairo-demo.py cairo-knockout.py hangman.py lsystem.py
png_view.py text.py
Log Message:
SC
Index: cairo-demo.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/cairo-demo.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cairo-demo.py 15 Apr 2005 03:25:37 -0000 1.3
+++ cairo-demo.py 9 May 2005 00:52:47 -0000 1.4
@@ -85,8 +85,7 @@
drawable.clear()
- ctx = cairo.Context()
- cairo.gtk.set_target_drawable(ctx, drawable)
+ ctx = cairo.gtk.create_cairo_context(drawable)
ctx.set_source_rgb(0, 0, 0)
ctx.set_line_width(SIZE / 4)
Index: cairo-knockout.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/cairo-knockout.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo-knockout.py 2 May 2005 02:25:51 -0000 1.4
+++ cairo-knockout.py 9 May 2005 00:52:47 -0000 1.5
@@ -91,9 +91,8 @@
xc = width / 2.
yc = height / 2.
- ctx = cairo.Context()
- cairo.gtk.set_target_drawable(ctx, drawable)
- surface = ctx.target_surface
+ ctx = cairo.gtk.create_cairo_context(drawable)
+ surface = ctx.target
overlay = surface.create_similar(cairo.FORMAT_ARGB32, width,height)
punch = surface.create_similar(cairo.FORMAT_A8, width,height)
@@ -119,7 +118,9 @@
ctx.restore()
ctx.set_operator(cairo.OPERATOR_OUT_REVERSE)
- ctx.show_surface(punch, width, height)
+ ctx.set_source_surface (punch, 0, 0)
+ ctx.paint()
+ #ctx.show_surface(punch, width, height)
ctx.save()
@@ -130,11 +131,15 @@
ctx.restore()
ctx.set_operator(cairo.OPERATOR_ADD)
- ctx.show_surface(circles, width, height)
+ ctx.set_source_surface (circles, 0, 0)
+ ctx.paint()
+ #ctx.show_surface(circles, width, height)
ctx.restore()
- ctx.show_surface(overlay, width, height)
+ ctx.set_source_surface (overlay, 0, 0)
+ ctx.paint()
+ #ctx.show_surface(overlay, width, height)
def main():
win = gtk.Window()
Index: hangman.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/hangman.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hangman.py 15 Apr 2005 03:25:37 -0000 1.4
+++ hangman.py 9 May 2005 00:52:47 -0000 1.5
@@ -66,11 +66,8 @@
pixmap = gtk.gdk.Pixmap (widget.window, width, height)
- ctx = cairo.Context()
- surface = cairo.gtk.surface_create_for_pixmap_with_visual(
- pixmap, widget.window.get_visual())
- ctx.set_target_surface (surface)
-
+ ctx = cairo.gtk.create_cairo_context(pixmap)
+
# set the background
ctx.set_source_rgb(0.7,0.7,0.7)
ctx.rectangle(0,0,width, height)
Index: lsystem.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/lsystem.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- lsystem.py 15 Apr 2005 03:25:37 -0000 1.3
+++ lsystem.py 9 May 2005 00:52:47 -0000 1.4
@@ -29,8 +29,8 @@
drawable.clear()
- ctx = cairo.Context()
- cairo.gtk.set_target_drawable(ctx, drawable)
+ ctx = cairo.gtk.create_cairo_context(drawable)
+
ctx.set_source_rgb(0, 0, 0)
ctx.set_line_width(self.SIZE / 4)
Index: png_view.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/png_view.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- png_view.py 5 May 2005 01:35:13 -0000 1.5
+++ png_view.py 9 May 2005 00:52:47 -0000 1.6
@@ -11,11 +11,7 @@
def expose_event(widget, event, surface):
widget.window.clear()
- ctx = cairo.Context()
- tsurface = cairo.gtk.surface_create_for_window_with_visual(
- widget.window, widget.window.get_visual())
- ctx.set_target_surface (tsurface)
-
+ ctx = cairo.gtk.create_cairo_context(widget.window)
ctx.set_source_surface(surface, 0,0)
ctx.paint()
Index: text.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/text.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- text.py 15 Apr 2005 03:25:37 -0000 1.4
+++ text.py 9 May 2005 00:52:47 -0000 1.5
@@ -7,8 +7,8 @@
def expose_event(widget, event):
widget.window.clear()
- ctx = cairo.Context()
- cairo.gtk.set_target_drawable(ctx, widget.window)
+ ctx = cairo.gtk.create_cairo_context(widget.window)
+
ctx.set_line_width(6)
ctx.set_tolerance(.1)
- Previous message: [cairo-commit]
pycairo/cairo pycairo-private.h, 1.19, 1.20 pycairo.h,
1.26, 1.27 cairomodule.c, 1.29, 1.30 cairogtkmodule.c, 1.17,
1.18 pycairo-pattern.c, 1.16, 1.17 pycairo-matrix.c, 1.13,
1.14 pycairo-context.c, 1.45, 1.46 pycairo-surface.c, 1.33,
1.34 pycairo-font.c, 1.12, 1.13
- Next message: [cairo-commit] pycairo ChangeLog, 1.105, 1.106 AUTHORS, 1.2,
1.3 NEWS, 1.8, 1.9 NOTES, 1.3, 1.4 pycairo.pc.in, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cairo-commit
mailing list