configure table widget attributes
(self, **kwargs)
| 590 | return {"column_index": selected_column_index, "values": selected_column_data} |
| 591 | |
| 592 | def configure(self, **kwargs): |
| 593 | """ configure table widget attributes""" |
| 594 | |
| 595 | if "colors" in kwargs: |
| 596 | self.colors = kwargs.pop("colors") |
| 597 | self.fg_color = self.colors[0] |
| 598 | self.fg_color2 = self.colors[1] |
| 599 | if "fg_color" in kwargs: |
| 600 | self.colors = (kwargs["fg_color"], kwargs.pop("fg_color")) |
| 601 | self.fg_color = self.colors[0] |
| 602 | self.fg_color2 = self.colors[1] |
| 603 | if "bg_color" in kwargs: |
| 604 | super().configure(bg_color=kwargs["bg_color"]) |
| 605 | self.inside_frame.configure(fg_color=kwargs["bg_color"]) |
| 606 | if "header_color" in kwargs: |
| 607 | self.header_color = kwargs.pop("header_color") |
| 608 | if "rows" in kwargs: |
| 609 | self.rows = kwargs.pop("rows") |
| 610 | if "columns" in kwargs: |
| 611 | self.columns = kwargs.pop("columns") |
| 612 | if "values" in kwargs: |
| 613 | self.values = kwargs.pop("values") |
| 614 | if "padx" in kwargs: |
| 615 | self.padx = kwargs.pop("padx") |
| 616 | if "pady" in kwargs: |
| 617 | self.pady = kwargs.pop("pady") |
| 618 | if "wraplength" in kwargs: |
| 619 | self.wraplength = kwargs.pop("wraplength") |
| 620 | |
| 621 | for i in range(self.rows): |
| 622 | for j in range(self.columns): |
| 623 | self.data[i,j]["args"].update(kwargs) |
| 624 | |
| 625 | if "hover_color" in kwargs: |
| 626 | self.hover_color = kwargs.pop("hover_color") |
| 627 | if "text_color" in kwargs: |
| 628 | self.text_color = kwargs.pop("text_color") |
| 629 | if "border_width" in kwargs: |
| 630 | self.border_width = kwargs.pop("border_width") |
| 631 | super().configure(border_width=self.border_width) |
| 632 | self.inside_frame.pack(expand=True, fill="both", padx=self.border_width, pady=self.border_width) |
| 633 | if "border_color" in kwargs: |
| 634 | self.border_color = kwargs.pop("border_color") |
| 635 | super().configure(border_color=self.border_color) |
| 636 | if "hover" in kwargs: |
| 637 | self.hover = kwargs.pop("hover") |
| 638 | if "anchor" in kwargs: |
| 639 | self.anchor = kwargs.pop("anchor") |
| 640 | if "corner_radius" in kwargs: |
| 641 | self.corner = kwargs.pop("corner_radius") |
| 642 | super().configure(corner_radius=self.corner) |
| 643 | if "color_phase" in kwargs: |
| 644 | self.phase = kwargs.pop("color_phase") |
| 645 | if "justify" in kwargs: |
| 646 | self.justify = kwargs.pop("justify") |
| 647 | if "orientation" in kwargs: |
| 648 | self.orient = kwargs.pop("orientation") |
| 649 | if "write" in kwargs: |
no test coverage detected