diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..00a3dd7 --- /dev/null +++ b/test/README.md @@ -0,0 +1,32 @@ +# Kivyblocks test + +## hello kivyblocks +``` +python main.py +``` + +## script +this is a standalone mode deploy +``` +cd test/scrip +python main.py +``` + +## gadget +[gadget](https://github.com/yumoqing/gadget) is a light wight web server, please read it documents to learn how to install and configure it to run it. +you need to start the gadget and change the port in test/gadget/conf/config.json before to run the following command +### download and run gadget + +``` +git clone git@github.com/yumoqing/gadget.git +pip install -r requirements.txt +cd gadget/test +python ../src/gadget.py +``` +if it run success, gadget is listen on prot 9080, then switch back to kivyblocks folder, then + +``` +cd test/gadget +python main.py +``` + diff --git a/test/gadget/conf/config.json b/test/gadget/conf/config.json new file mode 100644 index 0000000..47dce64 --- /dev/null +++ b/test/gadget/conf/config.json @@ -0,0 +1,18 @@ +{ + "font_sizes":{ + "smallest":1.5, + "small":2.5, + "normal":3.5, + "large":4.5, + "huge":5.5, + "hugest":6.5 + }, + "font_name":"normal", + "script_root":"$[workdir]$/scripts", + "root":{ + "widgettype":"urlwidget", + "options":{ + "url":"http://localhost:9080/index.tmpl" + } + } +} diff --git a/test/gadget/main.py b/test/gadget/main.py new file mode 100644 index 0000000..f7786c3 --- /dev/null +++ b/test/gadget/main.py @@ -0,0 +1,10 @@ +from kivyblocks.blocksapp import BlocksApp +from kivyblocks.blocks import registerWidget, Blocks +import kivyblocks.register + + +class ScriptApp(BlocksApp): + pass + +if __name__ == '__main__': + ScriptApp().run() diff --git a/test/rv.py b/test/rv.py index 461e6be..a038b88 100644 --- a/test/rv.py +++ b/test/rv.py @@ -41,6 +41,14 @@ class ResponsiveLayout(ScrollView): self.options = options super().__init__(**options) self._inner = VGridLayout(cols=cols,box_width=box_width) + self._inner.bind(minimum_height=self._inner.setter('height')) + super().add_widget(self._inner) + + def add_widget(self, widget,**kw): + self._inner.add_widget(widget, **kw) + print('here') + + class Box(BoxLayout): def __init__(self,**kw):