MCPcopy Index your code
hub / github.com/rawpython/remi / set_size

Method set_size

remi/gui.py:937–958  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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"""

Callers 10

__init__Method · 0.95
set_widget_layoutMethod · 0.45
resize_tab_titlesMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
mainMethod · 0.45
__init__Method · 0.45

Calls 1

to_pixFunction · 0.85

Tested by

no test coverage detected