- legend 'text' parameter for displaying static text

- table 'resize' method
This commit is contained in:
louisnw
2023-10-09 17:30:40 +01:00
parent 8b6a92be62
commit 33be333b41
4 changed files with 40 additions and 25 deletions

View File

@ -12,7 +12,7 @@ class Section(Pane):
def __call__(self, number_of_text_boxes: int, func: callable = None):
if func:
self.win.handlers[self.id] = lambda boxId: func(self._table.id, int(boxId))
self.win.handlers[self.id] = lambda boxId: func(self._table, int(boxId))
self.run_script(f'''
{self._table.id}.makeSection("{self.id}", "{self.type}", {number_of_text_boxes}, {"true" if func else ""})
''')
@ -104,6 +104,8 @@ class Table(Pane, dict):
def format(self, column: str, format_str: str): self._formatters[column] = format_str
def resize(self, width: NUM, height: NUM): self.run_script(f'{self.id}.reSize({width}, {height})')
def visible(self, visible: bool):
self.is_shown = visible
self.run_script(f"""