title: kivy language file root vs. <root> - loading by convention vs. loading by a Builder
body: <p>First of all, sorry for the long title, but I couldn't come up with a better way of phrasing my problem.</p>
  
  <p>Hello, I'm a bit confused by a notation in the kivy language files: According to the first lines of <a href="http://kivy.org/docs/guide/lang.html" rel="nofollow" title="this">this</a> document, the former syntax denotes a root item,</p>
  
  <pre><code>rootObj:
      Button:
          ....
  </code></pre>
  
  <p>whereas the latter one denotes some kind of rule:</p>
  
  <pre><code>&lt;rootObj&gt;:
      Button:
          ....
  </code></pre>
  
  <p>I thought that the former syntax describes what I call the root-object of that window as my python class, i.e. the python-class <code>rootObj</code> should be used as the root-object of my <code>example.kv</code>. Thus, I don't understand the purpose of the bracketed syntax. Suppose however, that I have the following files in a directory.</p>
  
  <pre><code>main.py
  main.kv
  </code></pre>
  
  <p>main.py looks like this:</p>
  
  <pre><code>def rootObj(Widget):
      pass
  
  def MainApp(App):
      def build(self):
          return rootObj()
  
  if __name__ == "__main__":
      MainApp().run()
  MainApp().run()
  </code></pre>
  
  <p>MainApp is run and by convention main.kv is loaded. Kivy calls <code>MainApp.build()</code> and that returns an instance of what I want to be the root-object. In order for this example to work, I must take the latter approach, which is specifying the name of the the root-object in those strange <code>&lt;&gt;</code> brackets. I wonder, why I have to specify the name of the root-Object when <code>MainApp.build()</code> does just that. Or am I totally mistaken here and kivy takes the rootObj() and appends the stuff in the <code>.kv-file</code>? Some enlightenment would come in handy.</p>
  
  <p>If I now change the directory-structure to something like this...</p>
  
  <pre><code> ui     
    \----main.kv     
   main.py
  </code></pre>
  
  <p>... and change <code>return rootObj()</code> to <code>return Builder.load_file("gui/main.kv")</code>, I suddenly have to use the bracketless syntax - but I don't know why. </p>
  
  <p>Could someome explain the differences in the syntaxes and the internas of how kivy handles loading by convention and loading by the Builder-object? </p>