Skip to content

Commit 3760fa7

Browse files
committed
Add skip method to leave empty cells in the current row
1 parent bd40669 commit 3760fa7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tk_grid_helper/tk_grid_helper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def __init__(self, grid: "Grid", row_index: int):
2727
self.column_index = 0
2828
self.cells = list()
2929

30+
def skip(self, count: int) -> "Row": # -> self
31+
self.column_index += count
32+
return self
33+
3034
def add(self, widget: tk.Widget, **kwargs) -> "Row": # -> self
3135
if self.cells:
3236
self.column_index += self.cells[-1].column_span
@@ -40,13 +44,13 @@ def add(self, widget: tk.Widget, **kwargs) -> "Row": # -> self
4044

4145
return self
4246

43-
def column_span(self, span: int): # -> Self
47+
def column_span(self, span: int) -> "Row": # -> Self
4448
if self.cells:
4549
self.cells[-1].column_span = span
4650

4751
return self
4852

49-
def row_span(self, span: int): # -> Self
53+
def row_span(self, span: int) -> "Row": # -> Self
5054
if self.cells:
5155
self.cells[-1].row_span = span
5256

0 commit comments

Comments
 (0)