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

Method append

remi/gui.py:1928–1965  ·  view source on GitHub ↗

It allows to add child widgets to this. The key allows to access the specific child in this way container.children[key]. The key have to be numeric and determines the children order in the layout. Args: value (Widget): Child instance to be appended. k

(self, value, key='')

Source from the content-addressed store, hash-verified

1926 self.style['align-items'] = self.style.get('align-items', 'center')
1927
1928 def append(self, value, key=''):
1929 """It allows to add child widgets to this.
1930 The key allows to access the specific child in this way container.children[key].
1931 The key have to be numeric and determines the children order in the layout.
1932
1933 Args:
1934 value (Widget): Child instance to be appended.
1935 key (str): Unique identifier for the child. If key.isdigit()==True '0' '1'.. the value determines the order
1936 in the layout
1937 """
1938 if type(value) in (list, tuple, dict):
1939 if type(value)==dict:
1940 for k in value.keys():
1941 self.append(value[k], k)
1942 return value.keys()
1943 keys = []
1944 for child in value:
1945 keys.append( self.append(child) )
1946 return keys
1947
1948 key = str(key)
1949 if not isinstance(value, Widget):
1950 raise ValueError('value should be a Widget (otherwise use add_child(key,other)')
1951
1952 del value.css_left
1953 del value.css_right
1954
1955 if value.css_order == None:
1956 value.css_position = 'static'
1957 value.css_order = '-1'
1958
1959 if key.isdigit():
1960 value.css_order = key
1961
1962 key = value.identifier if key == '' else key
1963 self.add_child(key, value)
1964
1965 return key
1966
1967
1968class VBox(HBox):

Callers 15

test_initMethod · 0.95
add_field_with_labelMethod · 0.95
add_fieldMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
handle_starttagMethod · 0.45
test_initMethod · 0.45
add_childMethod · 0.45
appendMethod · 0.45

Calls 1

add_childMethod · 0.80

Tested by 2

test_initMethod · 0.76
test_initMethod · 0.36