aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvidon2005-05-31 15:36:24 +0000
committervidon2005-05-31 15:36:24 +0000
commitae7fd23fc3f4f67ce2b413a0fdcf8fa84effadc8 (patch)
tree2ec5df717288c4d4b40d61c4495b8b55eb44d3f4
parent34d170b2d9a437ac4e671ba42d7ba110b00b6a38 (diff)
downloadtkzinc-ae7fd23fc3f4f67ce2b413a0fdcf8fa84effadc8.zip
tkzinc-ae7fd23fc3f4f67ce2b413a0fdcf8fa84effadc8.tar.gz
tkzinc-ae7fd23fc3f4f67ce2b413a0fdcf8fa84effadc8.tar.bz2
tkzinc-ae7fd23fc3f4f67ce2b413a0fdcf8fa84effadc8.tar.xz
Closed #2
Add doctrings
-rw-r--r--Python/library/Zinc.py.in35
1 files changed, 28 insertions, 7 deletions
diff --git a/Python/library/Zinc.py.in b/Python/library/Zinc.py.in
index 3c13335..c0c8531 100644
--- a/Python/library/Zinc.py.in
+++ b/Python/library/Zinc.py.in
@@ -108,8 +108,11 @@ class Zinc(Widget):
"""
args=list(args)
args=args+list(self._options(kw))
- return self.tk.getint(
- self.tk.call(self._w, 'add', itemType,*args))
+ try:
+ return self.tk.getint(
+ self.tk.call(self._w, 'add', itemType,*args))
+ except TclError, excpt :
+ ZincException("%s\nType %s\nArgs : %s"%(excpt,itemType,args))()
def addtag(self, *args):
"""
@@ -420,31 +423,31 @@ class Zinc(Widget):
"""
group=zinc.group(tagOrId)
"""
- self.tk.call(self._w,'group', *args)
+ return self.tk.call(self._w,'group', *args)
def hasanchors(self, *args):
"""
bool=zinc.hasanchors(tagOrId)
"""
- self.tk.call(self._w,'hasanchors', *args)
+ return self.tk.call(self._w,'hasanchors', *args)
def hasfields(self, *args):
"""
bool=zinc.hasfields(tagOrId)
"""
- self.tk.call(self._w,'hasfield', *args)
+ return self.tk.call(self._w,'hasfield', *args)
def hastag(self, *args):
"""
bool=zinc.hastag(tagOrId, tag)
"""
- self.tk.call(self._w, 'hastag', *args)
+ return self.tk.call(self._w, 'hastag', *args)
def index(self, *args):
"""
num = zinc.index(tagOrId, index)
"""
- self.tk.call(self._w,'tagOrId', *args)
+ return self.tk.call(self._w,'tagOrId', *args)
def insert(self, *args):
"""
@@ -497,6 +500,22 @@ class Zinc(Widget):
"""
zinc.loweritem(tagOrId)
zinc.loweritem(tagOrId, belowThis)
+ Reorder all the items given by tagOrId so that
+ they will be under the item given by belowThis.
+ If tagOrId name more than one item,
+ their relative order will be preserved.
+ If tagOrId doesn't name an item, an error is raised.
+ If belowThis name more than one item, the bottom most them is used.
+ If belowThis doesn't name an item, an error is raised.
+ If belowThis is omitted the items are put
+ at the bottom most position of their respective groups.
+ The command ignore all items named by tagOrId
+ that are not in the same group than belowThis or,
+ if not specified, in the same group than the first item
+ named by tagOrId. The command returns an empty string.
+ As a side affect of this command, the -priority attribute
+ of all the reordered items is ajusted to match the priority
+ of the belowThis item (or the priority of the bottom most item)
"""
self.tk.call(self._w,'lower', *args)
@@ -522,6 +541,8 @@ class Zinc(Widget):
def raiseitem(self, *args):
"""
+ Correspond ŕ l'appel raise de la documentation
+ le mot raise est reservé en python
zinc.raiseitem(tagOrId)
zinc.raiseitem(tagOrId, aboveThis)
"""