[cairo-commit] pycairo/examples/cairo_snippets snippets_gtk.py, 1.6, 1.7 snippets_pdf.py, 1.3, 1.4

Steve Chaplin commit at pdx.freedesktop.org
Sun May 15 18:05:30 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/examples/cairo_snippets
In directory gabe:/tmp/cvs-serv26464/examples/cairo_snippets

Modified Files:
	snippets_gtk.py snippets_pdf.py 
Log Message:
SC

Index: snippets_gtk.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets_gtk.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- snippets_gtk.py	9 May 2005 00:52:46 -0000	1.6
+++ snippets_gtk.py	16 May 2005 01:05:28 -0000	1.7
@@ -53,6 +53,9 @@
 
         self.da.realize()
         self._bg_rgb = gdkcolor_to_rgb (self.da.style.bg[gtk.STATE_NORMAL])
+
+        # set focus to snippet list
+        sl.get_child().grab_focus()        
         
         
     def da_expose_event (self, da, event, data=None):

Index: snippets_pdf.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets_pdf.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- snippets_pdf.py	9 May 2005 00:52:46 -0000	1.3
+++ snippets_pdf.py	16 May 2005 01:05:28 -0000	1.4
@@ -11,7 +11,6 @@
 from snippets import snip_list, snippet_normalize, snippet_set_bg_svg
 
 X_inches, Y_inches = 2, 2
-X_ppi, Y_ppi = 300, 300
 width, height = X_inches * 72, Y_inches * 72  # used by snippet_normalize()
 
 Verbose_mode = True
@@ -21,8 +20,8 @@
         print 'processing %s' % snippet,
     
     file_obj = file('snippets/%s.pdf' % snippet, 'wb')
-    surface = cairo.PDFSurface (file_obj, X_inches, Y_inches, X_ppi, Y_ppi)
-    cr = cairo.Context(surface)
+    surface = cairo.PDFSurface (file_obj, width, height)
+    cr = cairo.Context (surface)
 
     cr.save()
     try:
@@ -35,7 +34,7 @@
 
     cr.show_page()
     
-    surface.finish()
+    surface.finish() # to finish using file object
     file_obj.close()
 
     if Verbose_mode:




More information about the cairo-commit mailing list