From ae7fd23fc3f4f67ce2b413a0fdcf8fa84effadc8 Mon Sep 17 00:00:00 2001 From: vidon Date: Tue, 31 May 2005 15:36:24 +0000 Subject: Closed #2 Add doctrings --- Python/library/Zinc.py.in | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'Python') 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) """ -- cgit v1.1