title: Adding custom Buttons Dynamically Kivy
body: <p>I want to create custom buttons based on some list, dynamically in floatlayaout. How can I forward from here? </p>
  
  <pre><code>from kivy.uix.button import ButtonBehavior
  from kivy.uix.image import Image
  
  class Home(ScreenManager):
      pass
  
  class FirstSc(Screen):
      pass
  
  class ImBut(ButtonBehavior, Image):
      pass
  
  class SecSc(Screen):
      pass
  
  class Category(Screen):
      pass
  </code></pre>
  
  <p><code>customButton</code> is what I created in the root widget of the kivy, and want it to be populated dynamically based on the list I would provide, in "SecSc" screen floatlayout. how can I access the custombutton and add it to the 'SecSc' class?</p>
  
  <pre><code>root_widget = Builder.load_string('''
  Home:
      FirstSc:
      SecSc:
      Category:
  `THIS IS THE CUSTOM BUTTON`
  &lt;customButton@Button&gt;
      id: custbut
      font_size: 0.65 * self.height
      size_hint: (.15,.1)
      border_radius: [18]
      canvas.before:
          Color:
              rgba: self.back_color
          RoundedRectangle:
              size: self.size
              pos: self.pos
              radius: self.border_radius
  
  &lt;FirstSc&gt;:
      name: '1st'
      FloatLayout:
          canvas.before:
              Rectangle:
                  source: 'bg.png'
  
  &lt;SecSc&gt;:
      name: '2nd'
      FloatLayout:
          canvas.before:
              Rectangle:
                  source: 'bg.png'
          FloatLayout:
              id: grid
              `HERE I WOULD LIKE TO ADD BUTTONS`
  &lt;Category&gt;:
      name: 'category'
  
  ''')
  
  class MyiApp(App):
      def build(self):
          return root_widget
  
  MyiApp().run()
  </code></pre>