MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / RemiApp

Class RemiApp

gui-apps/app_remi.py:6–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5
6class RemiApp(App):
7 def main(self):
8 mainContainer = Container(width=706, height=445, margin='0px auto', style="position: relative")
9 subContainer = HBox(width=630, height=277, style='position: absolute; left: 40px; top: 150px; background-color: #b6b6b6')
10 vbox = VBox(width=300, height=250)
11 bt1 = Button('bt1', width=100, height=30)
12 vbox.append(bt1,'bt1')
13 bt3 = Button('bt3', width=100, height=30)
14 vbox.append(bt3,'bt3')
15 bt2 = Button('bt2', width=100, height=30)
16 vbox.append(bt2,'bt2')
17 subContainer.append(vbox,'vbox')
18 hbox = HBox(width=300, height=250)
19 lbl1 = Label('lbl1', width=50, height=50, style='background-color: #ffb509')
20 hbox.append(lbl1,'lbl1')
21 lbl2 = Label('lbl2', width=50, height=50, style='background-color: #40ff2b')
22 hbox.append(lbl2,'lbl2')
23 lbl3 = Label('lbl3', width=50, height=50, style='background-color: #e706ff')
24 hbox.append(lbl3,'lbl3')
25 subContainer.append(hbox,'hbox')
26 mainContainer.append(subContainer,'subContainer')
27 comboJustifyContent = gui.DropDown.new_from_list(('flex-start','flex-end','center','space-between','space-around'),
28 style='left: 160px; position: absolute; top: 60px; width: 148px; height: 30px')
29 mainContainer.append(comboJustifyContent,'comboJustifyContent')
30 lblJustifyContent = Label('justify-content', style='left: 40px; position: absolute; top: 60px; width: 100px; height: 30px')
31 mainContainer.append(lblJustifyContent,'lblJustifyContent')
32 comboAlignItems = gui.DropDown.new_from_list(('stretch','center','flex-start','flex-end','baseline'),
33 style='left:160px; position:absolute; top:100px; width:152px; height: 30px')
34 mainContainer.append(comboAlignItems,'comboAlignItems')
35 lblAlignItems = Label('align-items', style='left:40px; position:absolute; top:100px; width:100px; height:30px')
36 mainContainer.append(lblAlignItems,'lblAlignItems')
37 mainContainer.children['comboJustifyContent'].onchange.do(self.onchange_comboJustifyContent,vbox,hbox)
38 mainContainer.children['comboAlignItems'].onchange.do(self.onchange_comboAlignItems,vbox,hbox)
39
40 lblTitle = gui.Label("The following example shows the two main layout style properties for the VBox and HBox containers. Change the value of the two combo boxes.",
41 style='position:absolute; left:0px; top:0px')
42 mainContainer.append(lblTitle)
43
44 self.mainContainer = mainContainer
45 return self.mainContainer
46
47 def onchange_comboJustifyContent(self,emitter,new_value,vbox,hbox):
48 vbox.style['justify-content'] = new_value
49 hbox.style['justify-content'] = new_value
50
51 def onchange_comboAlignItems(self,emitter,new_value,vbox,hbox):
52 vbox.style['align-items'] = new_value
53 hbox.style['align-items'] = new_value
54
55
56

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected