MCPcopy
hub / github.com/beeware/toga / get_selection

Method get_selection

cocoa/src/toga_cocoa/widgets/table.py:237–256  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

235 self.native_table.reloadData()
236
237 def get_selection(self):
238 if self.interface.multiple_select:
239 selection = []
240
241 current_index = self.native_table.selectedRowIndexes.firstIndex
242 for _ in range(self.native_table.selectedRowIndexes.count):
243 selection.append(current_index)
244 current_index = (
245 self.native_table.selectedRowIndexes.indexGreaterThanIndex(
246 current_index
247 )
248 )
249
250 return selection
251 else:
252 index = self.native_table.selectedRow
253 if index != -1:
254 return index
255 else:
256 return None
257
258 def scroll_to_row(self, row):
259 self.native_table.scrollRowToVisible(row)

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected