Set the widget size. Args: width (int or str): An optional width for the widget (es. width=10 or width='10px' or width='10%'). height (int or str): An optional height for the widget (es. height=10 or height='10px' or height='10%').
(self, width, height)
| 935 | return not ('disabled' in self.attributes.keys()) |
| 936 | |
| 937 | def set_size(self, width, height): |
| 938 | """Set the widget size. |
| 939 | |
| 940 | Args: |
| 941 | width (int or str): An optional width for the widget (es. width=10 or width='10px' or width='10%'). |
| 942 | height (int or str): An optional height for the widget (es. height=10 or height='10px' or height='10%'). |
| 943 | """ |
| 944 | if width is not None: |
| 945 | try: |
| 946 | width = to_pix(int(width)) |
| 947 | except ValueError: |
| 948 | # now we know w has 'px or % in it' |
| 949 | pass |
| 950 | self.css_width = width |
| 951 | |
| 952 | if height is not None: |
| 953 | try: |
| 954 | height = to_pix(int(height)) |
| 955 | except ValueError: |
| 956 | # now we know w has 'px or % in it' |
| 957 | pass |
| 958 | self.css_height = height |
| 959 | |
| 960 | def redraw(self): |
| 961 | """Forces a graphic update of the widget""" |