title: Placing an image in the middle of the label in Kivy
body: <p>I have the following <code>Kivy</code> language file, which should mimic a dialer app. Also in the middle underneath the digits it should display an icon (<em>red rectangle</em>). However it seems that in my implementation the <code>parent</code>, <code>self</code> and <code>root</code> objects all have the same properties. What's wrong in my code? Is there a better way to do it?</p>
  
  <pre><code># File name: dialer.kv 
  #:kivy 1.9.0
  &lt;Button&gt;:
      color: .8,.9,0,.65
      font_size: 32
  
  &lt;MyGridLayout&gt;:
      rows: 3
      spacing: 10
      GridLayout:
          rows: 1
          size_hint_y: .40
          Label:            
              text: '12345678901231234567890'
              size: self.texture_size
              text_size: root.width, None
              font_size: 44
              halign: 'center'
              valign: 'middle'
              canvas.before:
                  Rectangle:
                      pos: self.parent.center_x - self.width / 2, self.parent.center_y - self.height / 2
                      source: 'bg.png'
      GridLayout:
          cols: 3
          rows: 4
          size_hint_y: .50
          spacing: 10
          Button:
              text: '1'
          Button:
              text: '2'
          Button:
              text: '3'
          Button:
              text: '4'
          Button:
              text: '5'
          Button:
              text: '6'
          Button:
              text: '7'
          Button:
              text: '8'
          Button:
              text: '9'
          Button:
              text: '*'
          Button:
              text: '0'
          Button:
              text: '#'
      GridLayout:
          cols: 2
          size_hint_y: .10
          spacing: 10
          Button:
              text: 'Clear'
          Button:
              text: 'Dial'
  </code></pre>
  
  <hr>
  
  <pre><code>#!/usr/bin/env python2
  # -*- coding: utf-8 -*-
  # File name: main.py
  
  import kivy
  kivy.require('1.9.0')
  
  from kivy.app import App
  from kivy.uix.gridlayout import GridLayout
  
  class MyGridLayout(GridLayout):
      pass
  
  class DialerApp(App):
      def build(self):
          return MyGridLayout()
  
  if __name__=="__main__":
      DialerApp().run()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/hoQNa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hoQNa.png" alt="Dialer app"></a></p>