kivy/doc/sources/gettingstarted/rules.rst

27 lines
935 B
ReStructuredText
Raw Normal View History

2012-04-04 10:04:52 +00:00
Kv Design Language
------------------
2013-05-07 06:56:37 +00:00
Kivy provides a design language specifically geared towards easy and scalable
GUI Design. The language makes it simple to separate the interface design from
the application logic, adhering to the
`separation of concerns principle
<http://en.wikipedia.org/wiki/Separation_of_concerns>`_. For example:
2012-04-04 10:04:52 +00:00
.. image:: ../images/gs-lang.png
:align: center
:height: 229px
2012-04-04 10:04:52 +00:00
In the above code :
.. code-block:: kv
2013-05-07 06:56:37 +00:00
<LoginScreen>: # every class in your app can be represented by a rule like
# this in the kv file
GridLayout: # this is how you add your widget/layout to the parent
# (note the indentation).
rows: 2 # this how you set each property of your widget/layout
2012-04-04 10:04:52 +00:00
2013-06-07 22:35:48 +00:00
That's it, that's how simple it is to design your GUI in the Kv language. For
2013-05-07 06:56:37 +00:00
a more in-depth understanding, please refer to the :doc:`/guide/lang`
documentation.