MCPcopy Create free account
hub / github.com/Akascape/CTkTable / CTkTable

Class CTkTable

CTkTable/ctktable.py:8–719  ·  view source on GitHub ↗

CTkTable Widget

Source from the content-addressed store, hash-verified

6import copy
7
8class CTkTable(customtkinter.CTkFrame):
9 """ CTkTable Widget """
10
11 def __init__(
12 self,
13 master: any,
14 row: int = None,
15 column: int = None,
16 padx: int = 1,
17 pady: int = 0,
18 width: int = 140,
19 height: int = 28,
20 values: list = None,
21 colors: list = [None, None],
22 orientation: str = "horizontal",
23 color_phase: str = "horizontal",
24 border_width: int = 0,
25 text_color: str or tuple = None,
26 border_color: str or tuple = None,
27 font: tuple = None,
28 header_color: str or tuple = None,
29 corner_radius: int = 25,
30 write: str = False,
31 command = None,
32 anchor: str = "c",
33 hover_color: str or tuple = None,
34 hover: bool = False,
35 justify: str = "center",
36 wraplength: int = 1000,
37 **kwargs):
38
39 super().__init__(master, fg_color="transparent")
40
41 if values is None:
42 values = [[None,None],[None,None]]
43
44 self.master = master # parent widget
45 self.rows = row if row else len(values) # number of default rows
46 self.columns = column if column else len(values[0])# number of default columns
47 self.width = width
48 self.height = height
49 self.padx = padx # internal padding between the rows/columns
50 self.pady = pady
51 self.command = command
52 self.values = values # the default values of the table
53 self.colors = colors # colors of the table if required
54 self.header_color = header_color # specify the topmost row color
55 self.phase = color_phase
56 self.corner = corner_radius
57 self.write = write
58 self.justify = justify
59 self.binded_objects = []
60
61 if self.write:
62 border_width = border_width=+1
63
64 if hover_color is not None and hover is False:
65 hover=True

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected