2012-04-04 10:04:52 +00:00
|
|
|
Kv Design Language
|
2012-04-06 16:21:17 +00:00
|
|
|
------------------
|
2012-04-04 10:38:24 +00:00
|
|
|
|
|
|
|
.. container:: title
|
|
|
|
|
2012-07-08 09:36:49 +00:00
|
|
|
Designing with the kv language.
|
2012-03-16 14:42:35 +00:00
|
|
|
|
2012-04-06 16:21:17 +00:00
|
|
|
Kivy provides a design language specifically geared towards ease of GUI Design,
|
2012-07-08 09:36:49 +00:00
|
|
|
which makes it easier to separate interface design and logic from internal design and
|
|
|
|
logic. For example:
|
2012-04-04 10:04:52 +00:00
|
|
|
|
2012-04-06 16:21:17 +00:00
|
|
|
.. image:: ../images/gs-lang.png
|
|
|
|
:align: center
|
|
|
|
:height: 229px
|
2012-04-04 10:04:52 +00:00
|
|
|
|
2012-04-04 19:38:00 +00:00
|
|
|
In the above code :
|
2012-04-04 10:38:24 +00:00
|
|
|
|
2012-04-04 19:38:00 +00:00
|
|
|
.. code-block:: kv
|
2012-04-04 20:19:20 +00:00
|
|
|
|
2012-04-06 16:21:17 +00:00
|
|
|
<LoginScreen>: # every class in your app can be represented by a rule like this in the kv file
|
2012-07-08 09:36:49 +00:00
|
|
|
GridLayout: # this is how you add your widget/layout to the parent (note the indentation).
|
2012-05-29 11:33:41 +00:00
|
|
|
rows: 2 # this how you set each property of your widget/layout
|
2012-04-04 10:04:52 +00:00
|
|
|
|
2012-07-08 09:36:49 +00:00
|
|
|
That's it, that's how simple it is to design your GUI in the kv language. To get a
|
2012-04-06 16:21:17 +00:00
|
|
|
more in-depth understanding look at :doc:`/guide/kvlang`
|