Returns a list of the content widgets. If no arguments are supplied, a list of all of the content in this container widget is returned, most recently managed first. If ROW or COLUMN is specified, only the content in the row or column is returned.
(self, row=None, column=None)
| 2054 | size = grid_size |
| 2055 | |
| 2056 | def grid_content(self, row=None, column=None): |
| 2057 | """Returns a list of the content widgets. |
| 2058 | |
| 2059 | If no arguments are supplied, a list of all of the content in this |
| 2060 | container widget is returned, most recently managed first. |
| 2061 | If ROW or COLUMN is specified, only the content in the row or |
| 2062 | column is returned. |
| 2063 | """ |
| 2064 | args = () |
| 2065 | if row is not None: |
| 2066 | args = args + ('-row', row) |
| 2067 | if column is not None: |
| 2068 | args = args + ('-column', column) |
| 2069 | try: |
| 2070 | res = self.tk.call('grid', 'content', self._w, *args) |
| 2071 | except TclError: |
| 2072 | if self.info_patchlevel() >= (8, 6): |
| 2073 | raise |
| 2074 | res = self.tk.call('grid', 'slaves', self._w, *args) |
| 2075 | return [self._nametowidget(x) for x in self.tk.splitlist(res)] |
| 2076 | |
| 2077 | def grid_slaves(self, row=None, column=None): |
| 2078 | """Synonym for grid_content().""" |