title: Kivy: create a custom widget and do a new instance from kv
body: <p>I'm trying to learn the Kivy api for a little project of mine, and I got stuck in this problem which I don't actually know if I'm approaching the right way.</p>
  
  <p>I created a custom class, inheriting from Widget, with some things that I know I will be repeating a lot:</p>
  
  <pre class="lang-py prettyprint-override"><code>#classes.py
  
  from kivy.uix.widget import Widget
  from kivy.uix.gridlayout import GridLayout
  from kivy.uix.label import Label
  from kivy.uix.textinput import TextInput
  from kivy.properties import ObjectProperty
  from kivy.properties import StringProperty
  
  class TextField(Widget):
      field_id = ObjectProperty(None)
      field_text = StringProperty('Label: ')
      field_placeholder = StringProperty('your text here')
  
      grid = GridLayout(cols=2)
      label = Label(text=field_text)
      tinput = TextInput(id=field_id, text=field_placeholder)
      grid.add_widget(label)
      grid.add_widget(tinput) 
  </code></pre>
  
  <p>Then I wanted to create the instance of my class in the kv file</p>
  
  <pre><code>#main.kv
  &lt;MainLayout&gt;
      cols:3
      TextField:
          field_id:'someid'
          field_text:'My Label: '
          field_placeholder: 'My placeholder'
  </code></pre>
  
  <p>Now, the problem is that when I run it I get:</p>
  
  <pre><code>ValueError: Label.text accept only str
  </code></pre>
  
  <p>and when I print field_text, I get</p>
  
  <pre><code>&lt;StringProperty name=&gt;
  </code></pre>
  
  <p>So I guess it isn't a str, just like the error says. Did I just completely misunderstood properties? Is what I want to do possible in other way?</p>
  
  <p>Thanks in advance for your time!</p>
  
  <hr>
  
  <p>EDIT: The only thing that I can think of thats missing from my question to make it 100% reproducible is the entry point.</p>
  
  <pre class="lang-py prettyprint-override"><code>#main.py
  import kivy
  kivy.require('1.8.0')
  
  from example.exampleapp import ExampleApp
  
  if __name__ == "__main__":
      ExampleApp().run()
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>#exampleapp.py
  from example.classes import *
  from kivy.uix.gridlayout import GridLayout
  
  with open('zapador/kv/main.kv', encoding='utf8') as f: 
      Builder.load_string(f.read())
  
  class Mainlayout(GridLayout):
      pass
  
  class ExampleApp(App):
  
      def build(self):
          return Mainlayout()
  </code></pre>