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

Method __init__

remi/gui.py:880–902  ·  view source on GitHub ↗

Args: style (dict, or json str): The style properties to be applied. width (int, str): An optional width for the widget (es. width=10 or width='10px' or width='10%'). height (int, str): An optional height for the widget (es. height=10 or height='10px' or

(self, style=None, *args, **kwargs)

Source from the content-addressed store, hash-verified

878 def css_position(self): del self.style['position']
879
880 def __init__(self, style=None, *args, **kwargs):
881
882 """
883 Args:
884 style (dict, or json str): The style properties to be applied.
885 width (int, str): An optional width for the widget (es. width=10 or width='10px' or width='10%').
886 height (int, str): An optional height for the widget (es. height=10 or height='10px' or height='10%').
887 margin (str): CSS margin specifier
888 """
889 if style is None:
890 style = {}
891 if '_type' not in kwargs:
892 kwargs['_type'] = 'div'
893
894 super(Widget, self).__init__(**kwargs)
895 EventSource.__init__(self, *args, **kwargs)
896
897 self.oldRootWidget = None # used when hiding the widget
898
899 if 'margin' in kwargs:
900 self.css_margin = kwargs.get('margin')
901 self.set_size(kwargs.get('width'), kwargs.get('height'))
902 self.set_style(style)
903
904 def set_style(self, style):
905 """ Allows to set style properties for the widget.

Callers

nothing calls this directly

Calls 3

set_sizeMethod · 0.95
set_styleMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected