Package: togax-xml-layout-plugin
togax-xml-layout-pluginXML unofficial Toga layout parserInstallationPyPipip install togax-xml-layout-pluginReasonGive developers the ability to define layouts in XML outside code. Also giving the final users the possibility to customize app layout without changing code.Examplelayout.xml<MainWindow><SplitContainer><ScrollContainer><Boxstyle="direction: column; padding: 10;"><!-- OptionContainer --><OptionContainerid="container"><OptionItemtext="1"><Boxstyle="direction: column; padding: 10;"><!-- ImageView --><Label>ImageView</Label><ImageView><Imagesrc="resources/srtranslator.png"/></ImageView><!-- WebView --><Label>WebView</Label><WebViewurl="https://beeware.org"style=" height: 500;"/><!-- Canvas --><Label>Canvas</Label><Canvasstyle="height: 100;"/></Box></OptionItem><OptionItemtext="2"><Boxstyle="direction: column; padding: 10;"><!-- DetailedList --><Label>DetailedList</Label><DetailedList><accessors><item>title</item><item>subtitle</item><item>icon</item></accessors><data><item><title>HEY1</title><subtitle>SelectionItem1</subtitle></item><item><title>HEY2</title><subtitle>SelectionItem2</subtitle></item><item><title>HEY3</title><subtitle>SelectionItem3</subtitle></item></data></DetailedList><!-- Table --><Label>Table</Label><Table><headings><item>name</item><item>Age</item></headings><data><item><name>HEY1</name><age>SelectionItem1</age></item><item><name>HEY2</name><age>SelectionItem2</age></item><item><name>HEY3</name><age>SelectionItem3</age></item></data></Table></Box></OptionItem></OptionContainer></Box></ScrollContainer><ScrollContainer><Boxstyle="direction: column; padding: 10;"><!-- ActivityIndicator --><Label>ActivityIndicator</Label><ActivityIndicatorrunning="true"/><!-- ProgressBar --><Label>ProgressBar</Label><ProgressBarvalue="10"max="30"/><!-- Divider --><Label>Divider</Label><Divider/><!-- MultilineTextInput --><Label>MultilineTextInput</Label><MultilineTextInputvalue="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."/><!-- TextInput --><Label>TextInput</Label><TextInputvalue="Lorem ipsum dolor sit amet"/><!-- NumberInput --><Label>NumberInput</Label><NumberInputvalue="1000"/><!-- PasswordInput --><Label>PasswordInput</Label><PasswordInput/><!-- Button --><Label>Button</Label><Buttonon_press=".test_button">Button</Button><!-- Slider --><Label>Slider</Label><Slidervalue="50"min="0"max="100"/><!-- Switch --><Switchvalue="true">Switch</Switch><!-- Selection --><Label>Selection</Label><Selection><items><item>SelectionItem1</item><item>SelectionItem2</item><item>SelectionItem3</item></items></Selection><!-- Selection with dictionaries --><Label>Selectionwithdictionaries</Label><Selection><items><item><name>HEY1</name><value>SelectionItem1</value></item><item><name>HEY2</name><value>SelectionItem2</value></item><item><name>HEY3</name><value>SelectionItem3</value></item></items></Selection></Box></ScrollContainer></SplitContainer></MainWindow>app.pyimporttogafromtogax_xml_layoutimportparse_layoutclassApp(toga.App):defstartup(self):withopen(f"{self.paths.app}/resources/layout.xml","r")asf:self.main_window=parse_layout(self,f.read())self.main_window.show()deftest_button(self,widget):print("clicked")