[cairo-commit] pycairo/examples/gtk cairo-demo.py, 1.9, 1.10 cairo-knockout.py, 1.13, 1.14 hangman.py, 1.9, 1.10 lsystem.py, 1.8, 1.9 png_view.py, 1.10, 1.11 text.py, 1.9, 1.10

Steve Chaplin commit at pdx.freedesktop.org
Thu Dec 21 03:36:50 PST 2006


Committed by: stevech1097

Update of /cvs/cairo/pycairo/examples/gtk
In directory kemper:/tmp/cvs-serv7460/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.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cairo-demo.py	20 Jan 2006 11:15:21 -0000	1.9
+++ cairo-demo.py	21 Dec 2006 11:36:46 -0000	1.10
@@ -3,8 +3,6 @@
 """
 import cairo
 import gtk
-if gtk.pygtk_version < (2,7,0):
-    import cairo.gtk
 
 SIZE = 30
 
@@ -80,10 +78,7 @@
     draw_shapes(ctx, x, y, False)
 
 def expose (da, event):
-    if gtk.pygtk_version < (2,7,0):
-        ctx = cairo.gtk.gdk_cairo_create(da.window)
-    else:
-        ctx = da.window.cairo_create()
+    ctx = da.window.cairo_create()
 
     ctx.set_source_rgb(0, 0, 0)
 

Index: cairo-knockout.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/cairo-knockout.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cairo-knockout.py	20 Jan 2006 11:15:21 -0000	1.13
+++ cairo-knockout.py	21 Dec 2006 11:36:46 -0000	1.14
@@ -8,8 +8,6 @@
 
 import cairo
 import gtk
-if gtk.pygtk_version < (2,7,0):
-    import cairo.gtk
 
 
 def oval_path(ctx, xc, yc, xr, yr):
@@ -106,10 +104,7 @@
     ctx.paint()
 
 def expose(drawingarea, event):
-    if gtk.pygtk_version < (2,7,0):
-        ctx = cairo.gtk.gdk_cairo_create(drawingarea.window)
-    else:
-        ctx = drawingarea.window.cairo_create()
+    ctx = drawingarea.window.cairo_create()
 
     _, _, width, height = drawingarea.allocation
     draw (ctx, width, height)

Index: hangman.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/hangman.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- hangman.py	20 Jan 2006 11:15:21 -0000	1.9
+++ hangman.py	21 Dec 2006 11:36:46 -0000	1.10
@@ -29,8 +29,6 @@
 
 import cairo
 import gtk
-if gtk.pygtk_version < (2,7,0):
-    import cairo.gtk
 
 letters_guessed = ""
 letters_guessed_right = ""
@@ -65,11 +63,7 @@
         size = height
 
     pixmap = gtk.gdk.Pixmap (widget.window, width, height)
-
-    if gtk.pygtk_version < (2,7,0):
-        ctx = cairo.gtk.gdk_cairo_create(pixmap)
-    else:
-        ctx = pixmap.cairo_create()
+    ctx = pixmap.cairo_create()
 
     # set the background
     ctx.set_source_rgb(0.7,0.7,0.7)

Index: lsystem.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/lsystem.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- lsystem.py	29 Aug 2005 02:31:20 -0000	1.8
+++ lsystem.py	21 Dec 2006 11:36:46 -0000	1.9
@@ -2,8 +2,6 @@
 
 import cairo
 import gtk
-if gtk.pygtk_version < (2,7,0):
-    import cairo.gtk
 
 # Copyright 2003 Jesse Andrews (jdandr2 at uky.edu) under GPL
 
@@ -27,11 +25,7 @@
         drawable = drawingarea.window
         x, y, width, height = drawingarea.allocation
 
-        if gtk.pygtk_version >= (2,7,0):
-            ctx = drawable.cairo_create()
-        else:
-            ctx = cairo.gtk.gdk_cairo_create(drawable)
-
+        ctx = drawable.cairo_create()
         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.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- png_view.py	29 Aug 2005 02:31:20 -0000	1.10
+++ png_view.py	21 Dec 2006 11:36:46 -0000	1.11
@@ -6,15 +6,10 @@
 
 import cairo
 import gtk
-if gtk.pygtk_version < (2,7,0):
-    import cairo.gtk
 
 
 def expose_event(widget, event, surface):
-    if gtk.pygtk_version >= (2,7,0):
-        ctx = widget.window.cairo_create()
-    else:
-        ctx = cairo.gtk.gdk_cairo_create(widget.window)
+    ctx = widget.window.cairo_create()
     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.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- text.py	29 Aug 2005 02:31:20 -0000	1.9
+++ text.py	21 Dec 2006 11:36:46 -0000	1.10
@@ -2,14 +2,10 @@
 
 import cairo
 import gtk
-if gtk.pygtk_version < (2,7,0):
-    import cairo.gtk
+
 
 def expose_event(widget, event):
-    if gtk.pygtk_version >= (2,7,0):
-        ctx = widget.window.cairo_create()
-    else:
-        ctx = cairo.gtk.gdk_cairo_create(widget.window)
+    ctx = widget.window.cairo_create()
 
     ctx.set_line_width(6)
     ctx.set_tolerance(.1)



More information about the cairo-commit mailing list