title: How to make changes to a widget in another class in kivy
body: <p>I'm new to OOP and kivy, I created an exam time table, for each timetable there are 2 buttons <strong>Edit</strong> and <strong>remove</strong>.
  I want whenever I click the <strong>remove</strong> button, a <code>remove_entry()</code> function from <strong>Exam</strong> class to be called and that function should remove that particular entry.<br>For <strong>Edit</strong> button, when clicked, a dialogbox will open with some textfields, I want by the time user cliked on <strong>save</strong> button, <code>make_changes()</code> function from <strong>Exam</strong> to be called and that function should make changes to some timetables.</p>
  <p><strong>This is the python file</strong></p>
  <pre><code>from kivymd.app import MDApp
  from kivy.uix.boxlayout import BoxLayout
  from kivy.core.window import Window
  from kivy.lang import Builder
  from kivy.properties import ObjectProperty, StringProperty
  from kivy.factory import Factory
  from kivy.uix.screenmanager import ScreenManager, Screen
  from kivymd.uix.button import MDFlatButton
  from kivymd.uix.dialog import MDDialog
  from kivymd.uix.textfield import MDTextField
  from kivymd.uix.picker import MDTimePicker
  from kivy.metrics import dp
  import datetime
  Window.keyboard_anim_args = {'d': .2, 't': 'in_out_expo'}
  Window.softinput_mode = &quot;below_target&quot;
  
  
  class Menu(Screen):
      pass
      
  #exam timetable screen
  class Exam(Screen):
      exam_btn = ObjectProperty()
      dept_exam = ObjectProperty()
      
      def on_enter(self):
          for item in self.Entries():
              self.dept_exam.add_widget(item, 1)
      
      #automatically insert the saved entries
      def Entries(self):
          global num
          
          ##The saved entries
          #f = [line.strip() for line in open('courses.txt') if line.strip() != '']
          f = ['CSC 221@27/4/2021@03:00 - 06:00@Gado Nasko',
                'CSC 212@2/5/2021@02:00 - 04:00@Gado Nasko']
          L = [Factory.OneEntry() for i in range(len(f))]
          
          #set  data to each of the entry
          num = 0
          for entry in L:
              items = f[num].split('@')
              entry.ids.exam_index.text = str(num+1)
              entry.ids.code.text = items[0]
              entry.ids.date.text += self.manp_date(items[1])
              entry.ids.time.text += items[2]
              entry.ids.venue.text += items[3]
              num += 1
              
          return L
      
      #add an entry by releasing the add button
      def adds(self):
          global num
          
          num += 1
          new = Factory.OneEntry()
          new.ids.exam_index.text = str(num)
          self.dept_exam.add_widget(new,1)
          
  
      #change date format
      def manp_date(self, dt):
          dy,mt,yr = dt.split('/')
          x = datetime.datetime(int(yr), int(mt), int(dy))
          return x.strftime('%d %b, %Y')
      
      #this should be called from TimeTabelApp
      def make_changes(self, change):
          pass
      
      #this should remove entry
      def remove_entry(self):
          pass
          
          
          
  #The dialog box for editing an entry class
  class Content(BoxLayout):
      #setting date function
      def show_date(self):
          self.ids.date_ent.hint_text = ''
          self.ids.date_ent.helper_text_mode = 'persistent'
          self.ids.date_ent.helper_text = 'dd/mm/yyyy'
      
          
      #setting time function
      def get_time(self, instance, time):
          self.ids.from_time.text = time
          self.ids.from_time.hint_text = ''
          self.ids.from_time.helper_text_mode = 'persistent'
          self.ids.from_time.helper_text = 'From'
      
      def show_time_picker(self):
          time_dialog = MDTimePicker()
          time_dialog.bind(time=self.get_time)
          time_dialog.open()
  
  class MainMenu(ScreenManager):
      pass
  
  kv = Builder.load_file('newfile.kv')
  
  
  
  class TimeTableApp(MDApp):
      def build(self):
          return kv
      
      #The dialog box for editing an entry function
      dialog = None
      def show_exam_dialog(self, counter):
  
          if not self.dialog:
              self.dialog = MDDialog(title=&quot;Set: Time, Venue, ...&quot;,
                                  type=&quot;custom&quot;, content_cls=Content(),
                                      buttons=[ MDFlatButton(text=&quot;CANCEL&quot;, on_release=self.close_dialog,
                                                              text_color=self.theme_cls.primary_color),
                                                    MDFlatButton(text=&quot;SAVE&quot;, on_release=self.save_dialog,
                                                              text_color=self.theme_cls.primary_color)])
          self.dialog.open()
          self.dialog.set_normal_height()
       
       #closing editing dialog
      def close_dialog(self, *args):
          self.dialog.dismiss()
      
      #saving changes from dialog
      def save_dialog(self, inst):
          exam_code = self.dialog.content_cls.ids.exam_code
          from_time = self.dialog.content_cls.ids.from_time
          date_ent = self.dialog.content_cls.ids.date_ent
          exam_venue = self.dialog.content_cls.ids.exam_venue
          
          change = exam_code.text.upper()+'@'+date_ent.text+'@'+exam_venue.text.title()
          #self.Exam().make_change(change)
          self.dialog.dismiss()
              
        
  if __name__ == '__main__':
      TimeTableApp().run()
  </code></pre>
  <p><strong>This is the kv file</strong></p>
  <pre><code>MainMenu:
      Menu:
      Exam:
  
  &lt;Menu&gt;:
      name: 'menu'
      BoxLayout:
          orientation: 'vertical'
          
          Button:
              text: 'Exam Timetable'
              on_release: app.root.current = 'exam'
      
  
  
  &lt;Exam&gt;:
      name: 'exam'
      dept_exam: dept_exam
  
      BoxLayout:
          orientation: 'vertical'
          padding: [0,20,0,0]
          
          ScrollView:
              effect_cls: 'ScrollEffect'
              GridLayout:
                  id: dept_exam
                  size_hint:(1, None)
                  width: self.minimum_width
                  height: self.minimum_height
                  cols: 1
                  spacing: 30
                  padding: [10]
           
                  
                  #add entry button layout
                  BoxLayout:
                      orientation: 'vertical'
                      size_hint: 1, None
                      height: 150
                      
                      Button:
                          id: btn
                          size_hint: None,1
                          width: 150
                          text: '+'
                          font_size: 80
                          background_color: 0,0,0,0
                          pos_hint: {'center_x':.5}
                          on_release: root.adds()
                          canvas.before:
                              Color:
                                  rgba: (.7, .1, .4, 1) if self.state=='normal' else (0,.7,.7,1)
                              RoundedRectangle:
                                  size: self.size
                                  pos: self.pos
                                  radius: [80]
  
  #An entry class
  &lt;OneEntry@BoxLayout&gt;:
      orientation: 'vertical'
      size_hint_y: None
      height: 250
      canvas.before:
          Color:
              rgba: (0, 117/255, 1, 1)
          RoundedRectangle:
              size: self.size
              pos: self.pos
              radius: [20]
      
      BoxLayout:
          orientation: 'horizontal'
          size_hint_y: .45
          Label:
              id: exam_index
              bold: True
              italic: True
              color: (114/255, 47/255, 55/255, 1)
              
          Label:
              id: code
              bold: True
              text_size: self.size
              halign: 'left'
              size_hint_x: 1.8
              font_size: 43
              
      #line
      Separator:
      
      GridLayout:
          cols: 2
          GridLayout:
              rows: 2
              size_hint_x: .8
              Label:
                  id: date
                  markup: True
                  text: '[size=35][b]Date:[/b][/size] '
              Label:
                  id: time
                  markup: True
                  text: '[size=35][b]Time:[/b][/size] '
                  
          BoxLayout:
              orientation: 'vertical'
              Label:
                  id: venue
                  markup: True
                  text: '[size=35][b]venue:[/b][/size] '
                  text_size: self.size
                  halign: 'left'
                  valign: 'middle'
              Label:
                  text_size: self.size
                  halign: 'left'
                  valign: 'middle'
                  markup: True
                  text: '[size=35][b]Status:[/b][/size] '
                  
      GridLayout:
          size_hint_y: .6
          padding: [20,10]
          cols: 2
          spacing: 10
  
          Button:
              text: 'Edit'
              background_color: (0, 117/255, 1, 1)
              on_release: app.show_exam_dialog(root.ids.exam_index.text)
          Button:
              text: 'Remove'
              background_color: (1, 0, 0, 1)
              on_release: root.remove_entry()
  
  
  &lt;Separator@Widget&gt;
      size_hint_y: None
      height: 1
      canvas:
          Color:
              rgb: 1, 1, 1
          Rectangle:
              pos: self.pos
              size: self.size
              
              
  &lt;Content&gt;
      orientation: &quot;vertical&quot;
      spacing: &quot;12dp&quot;
      size_hint_y: None
      height: 550
  
      MDTextField:
          id: exam_code
          hint_text: &quot;Course Code&quot;
          max_text_length: 7
          helper_text_mode: 'on_focus'
          helper_text: 'Not more than 7 character'
          required: True
  
      
      MDTextField:
          id: from_time
          hint_text: &quot;Set Time&quot;
          on_focus: if self.focus: root.show_time_picker
             
      MDBoxLayout:
          orientation: 'vertical'
          spacing: 5
          
          MDLabel:
              text: 'Set Date'
          
          MDBoxLayout:
              orientation: 'horizontal'
              MDTextField:
                  id: date_ent
                  on_focus: if self.focus: root.show_date() 
                  hint_text: &quot;dd/mm/yyyy&quot;
                  required: True
      
      MDTextField:
          id: exam_venue
          hint_text: &quot;Venue&quot;
          max_text_length: 20
          helper_text_mode: 'on_focus'
          helper_text: 'Not more than 20 character'
          required: True
              
  </code></pre>