Counts the number of relevant things between the two indices. If index1 is after index2, the result will be a negative number (and this holds for each of the possible options). The actual items which are counted depends on the options given by args. The result i
(self, index1, index2, *args)
| 3658 | self._w, 'compare', index1, op, index2)) |
| 3659 | |
| 3660 | def count(self, index1, index2, *args): # new in Tk 8.5 |
| 3661 | """Counts the number of relevant things between the two indices. |
| 3662 | If index1 is after index2, the result will be a negative number |
| 3663 | (and this holds for each of the possible options). |
| 3664 | |
| 3665 | The actual items which are counted depends on the options given by |
| 3666 | args. The result is a list of integers, one for the result of each |
| 3667 | counting option given. Valid counting options are "chars", |
| 3668 | "displaychars", "displayindices", "displaylines", "indices", |
| 3669 | "lines", "xpixels" and "ypixels". There is an additional possible |
| 3670 | option "update", which if given then all subsequent options ensure |
| 3671 | that any possible out of date information is recalculated.""" |
| 3672 | args = ['-%s' % arg for arg in args] |
| 3673 | args += [index1, index2] |
| 3674 | res = self.tk.call(self._w, 'count', *args) or None |
| 3675 | if res is not None and len(args) <= 3: |
| 3676 | return (res, ) |
| 3677 | else: |
| 3678 | return res |
| 3679 | |
| 3680 | def debug(self, boolean=None): |
| 3681 | """Turn on the internal consistency checks of the B-Tree inside the text |