[cairo-commit] pycairo/examples/cairo_snippets snippets_gtk.py, 1.1, 1.2

Steve Chaplin commit at pdx.freedesktop.org
Wed Apr 6 17:50:21 PDT 2005


Committed by: stevech1097

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

Modified Files:
	snippets_gtk.py 
Log Message:
SC 2005/04/07

Index: snippets_gtk.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets_gtk.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- snippets_gtk.py	6 Apr 2005 13:54:10 -0000	1.1
+++ snippets_gtk.py	7 Apr 2005 00:50:19 -0000	1.2
@@ -11,8 +11,6 @@
 
 from snippets import snip_list, snippet_normalize, snippet_set_bg_svg
 
-M_PI = math.pi   # used by many snippets
-
 Width, Height = 400, 400
     
 
@@ -32,32 +30,26 @@
         self.da.connect('expose-event', self.da_expose_event)
         self.da.connect('size-allocate', self.da_size_allocate)
 
+        def put_in_frame (widget):
+            frame = gtk.Frame (label=None)
+            frame.set_property ('shadow_type', gtk.SHADOW_IN)
+            frame.add (widget)
+            return frame
+
         vpaned = gtk.VPaned()
         self.add (vpaned)
 
-        frame = gtk.Frame (label=None)        
-        vpaned.pack1 (frame, True, True)
-        frame.set_property ('shadow_type', gtk.SHADOW_IN)
-
         sv = self.create_source_view()
-        frame.add (sv)
+        vpaned.pack1 (put_in_frame (sv), True, True)
         sv.set_size_request (Width, int(Height/2))
 
         hpaned = gtk.HPaned()
         vpaned.pack2 (hpaned, True, False)
 
-        frame = gtk.Frame (label=None)
-        hpaned.pack1 (frame, True, True)
-        frame.set_property ('shadow_type', gtk.SHADOW_IN)
-
         sl = self.create_snippet_list()
-        frame.add (sl)
-        
-        frame = gtk.Frame (label=None)
-        hpaned.pack2 (frame, True, True)
-        frame.set_property ('shadow_type', gtk.SHADOW_IN)
+        hpaned.pack1 (put_in_frame (sl), True, True)
         
-        frame.add (self.da)
+        hpaned.pack2 (put_in_frame (self.da), True, True)
         self.da.set_size_request (int(Width/2), int(Height/2))
 
         self.da.realize()




More information about the cairo-commit mailing list