Author: dmeyer
Date: Wed May  3 10:52:22 2006
New Revision: 1531

Modified:
   trunk/canvas/src/object.py

Log:
fix bug when without parent, add scale template and unparent

Modified: trunk/canvas/src/object.py
==============================================================================
--- trunk/canvas/src/object.py  (original)
+++ trunk/canvas/src/object.py  Wed May  3 10:52:22 2006
@@ -280,11 +280,12 @@
             margin = 0, 0, 0, 0
 
         left, top, right, bottom, hcenter, vcenter = pos
-        if None in pos[:2]:
+
+        if None in pos[:2] and self._parent:
             computed_size = self._get_computed_size()
             parent_size = self._parent._get_computed_size(child_asking = self)
-        elif isinstance(left, str) or isinstance(top, str) or (left != None 
and right != None) or \
-             (top != None and bottom != None):
+        elif (isinstance(left, str) or isinstance(top, str) or (left != None 
and right != None) or \
+             (top != None and bottom != None)) and self._parent:
             parent_size = self._parent._get_computed_size(child_asking = self)
         else:
             parent_size = [0, 0]  # dummy values
@@ -770,6 +771,10 @@
         if self._canvas:
             return self._canvas.get_evas()
 
+    def unparent(self):
+        if self._parent:
+            self._parent.remove_child(self)
+
     #
     # Position property methods
     #
@@ -932,6 +937,10 @@
     def get_computed_outer_size(self):
         return self._get_computed_outer_size()
 
+    def scale(self, width=None, height=None):
+        # FIXME, BTW, why width and height and not size as tuple?
+        return self.resize(width, height)
+
 
     #
     # clip property methods
@@ -1010,4 +1019,3 @@
 
     def get_padding(self):
         return self["padding"]
-


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to