MCPcopy Index your code
hub / github.com/rawpython/remi / set_row_count

Method set_row_count

remi/gui.py:3071–3092  ·  view source on GitHub ↗

Sets the table row count. Args: count (int): number of rows

(self, count)

Source from the content-addressed store, hash-verified

3069 return None
3070
3071 def set_row_count(self, count):
3072 """Sets the table row count.
3073
3074 Args:
3075 count (int): number of rows
3076 """
3077 current_row_count = self.row_count
3078 current_column_count = self.column_count
3079 if count > current_row_count:
3080 cl = TableEditableItem if self._editable else TableItem
3081 for i in range(current_row_count, count):
3082 tr = TableRow()
3083 for c in range(0, current_column_count):
3084 tr.append(cl(), str(c))
3085 if self._editable:
3086 tr.children[str(c)].onchange.connect(
3087 self.on_item_changed, int(i), int(c))
3088 self.append(tr, str(i))
3089 self._update_first_row()
3090 elif count < current_row_count:
3091 for i in range(count, current_row_count):
3092 self.remove_child(self.children[str(i)])
3093
3094 def set_column_count(self, count):
3095 """Sets the table column count.

Callers 3

row_countMethod · 0.95
__init__Method · 0.95
on_row_count_changeMethod · 0.80

Calls 6

appendMethod · 0.95
_update_first_rowMethod · 0.95
TableRowClass · 0.85
connectMethod · 0.80
appendMethod · 0.45
remove_childMethod · 0.45

Tested by

no test coverage detected