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

Method main

examples/grid_layout_app.py:34–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32
33class MyApp(App):
34 def main(self):
35 #creating a container GridBox type
36 main_container = gui.GridBox(width='100%', height='100%', style={'margin':'0px auto'})
37
38 label = gui.Label('This is a label')
39 label.style['background-color'] = 'lightgreen'
40
41 button = gui.Button('Change layout', height='100%')
42 button.onclick.do(self.redefine_grid, main_container)
43
44 text = gui.TextInput()
45
46 main_container.set_from_asciiart("""
47 |label |button |
48 |label |text |
49 |label |text |
50 |label |text |
51 |label |text |
52 """, 10, 10)
53
54 main_container.append({'label':label, 'button':button, 'text':text})
55
56 # returning the root widget
57 return main_container
58
59 def redefine_grid(self, emitter, container):
60 #redefining grid layout

Callers

nothing calls this directly

Calls 3

set_from_asciiartMethod · 0.95
appendMethod · 0.95
doMethod · 0.45

Tested by

no test coverage detected