Skip to content

Commit

Permalink
Add skip method to leave empty cells in the current row
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Jun 18, 2022
1 parent bd40669 commit 3760fa7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tk_grid_helper/tk_grid_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def __init__(self, grid: "Grid", row_index: int):
self.column_index = 0
self.cells = list()

def skip(self, count: int) -> "Row": # -> self
self.column_index += count
return self

def add(self, widget: tk.Widget, **kwargs) -> "Row": # -> self
if self.cells:
self.column_index += self.cells[-1].column_span
Expand All @@ -40,13 +44,13 @@ def add(self, widget: tk.Widget, **kwargs) -> "Row": # -> self

return self

def column_span(self, span: int): # -> Self
def column_span(self, span: int) -> "Row": # -> Self
if self.cells:
self.cells[-1].column_span = span

return self

def row_span(self, span: int): # -> Self
def row_span(self, span: int) -> "Row": # -> Self
if self.cells:
self.cells[-1].row_span = span

Expand Down

0 comments on commit 3760fa7

Please sign in to comment.