Index: /branch/ggpolo/umitInventory/new-sample/tests/_test4.py
===================================================================
--- /branch/ggpolo/umitInventory/new-sample/tests/_test4.py (revision 800)
+++ /branch/ggpolo/umitInventory/new-sample/tests/_test4.py (revision 801)
@@ -48,2 +48,64 @@
 gobject.type_register(test4A)
 
+
+class test4B(gtk.Widget):
+    def __init__(self):
+        gtk.Widget.__init__(self)
+        self.x = 0
+        self.y = 0
+
+    def do_realize(self):
+        self.set_flags(self.flags() | gtk.REALIZED)
+
+        self.window = gtk.gdk.Window(self.get_parent_window(),
+                                     width=self.allocation.width,
+                                     height=self.allocation.height,
+                                     window_type=gtk.gdk.WINDOW_CHILD,
+                                     wclass=gtk.gdk.INPUT_OUTPUT,
+                                     event_mask=self.get_events() |
+                                                gtk.gdk.EXPOSURE_MASK)
+
+        self.window.set_user_data(self)
+        self.style.attach(self.window)
+        self.style.set_background(self.window, gtk.STATE_NORMAL)
+        self.window.move_resize(*self.allocation)
+
+    def do_unrealize(self):
+        self.window.set_user_data(None)
+
+    def do_size_request(self, requisition):
+        requisition.width = 250
+        requisition.height = 250
+
+    def do_size_allocate(self, allocation):
+        self.allocation = allocation
+
+        if self.flags() & gtk.REALIZED:
+            self.window.move_resize(*allocation)
+
+    def do_expose_event(self, event):
+        cr = self.window.cairo_create()
+        cr.rectangle(*event.area)
+        cr.clip()
+
+                
+        cr.rectangle(self.x, self.y, 50, 50)
+        cr.fill()
+
+        gobject.timeout_add(25, self.timeout)
+
+    def timeout(self):
+        if self.y + 50 > self.allocation[3]:
+            self.y = self.allocation[3] - 50
+            self.x += 5
+        if self.x + 50 > self.allocation[2]:
+            self.y -= 5
+            self.x = self.allocation[2] - 49
+        else:
+            self.y += 5
+
+        self.queue_draw()
+        return False
+
+
+gobject.type_register(test4B)
Index: /branch/ggpolo/umitInventory/new-sample/tests/test5.py
===================================================================
--- /branch/ggpolo/umitInventory/new-sample/tests/test5.py (revision 801)
+++ /branch/ggpolo/umitInventory/new-sample/tests/test5.py (revision 801)
@@ -0,0 +1,15 @@
+import gtk
+import _test4
+
+class win(gtk.Window):
+    def __init__(self):
+        gtk.Window.__init__(self)
+
+        self.add(_test4.test4B())
+        self.connect('delete-event', lambda x,y:gtk.main_quit())
+
+if __name__ == "__main__":
+    w = win()
+    w.show_all()
+    gtk.main()
+        
