Allows to set style properties for the widget. Args: style (str or dict): The style property dictionary or json string.
(self, style)
| 902 | self.set_style(style) |
| 903 | |
| 904 | def set_style(self, style): |
| 905 | """ Allows to set style properties for the widget. |
| 906 | Args: |
| 907 | style (str or dict): The style property dictionary or json string. |
| 908 | """ |
| 909 | if style is not None: |
| 910 | try: |
| 911 | self.style.update(style) |
| 912 | except ValueError: |
| 913 | for s in style.split(';'): |
| 914 | k, v = s.split(':', 1) |
| 915 | self.style[k.strip()] = v.strip() |
| 916 | |
| 917 | def set_enabled(self, enabled): |
| 918 | """ Sets the enabled status. |