title: Python3: Can't get Gtk.SpinButton value
body: <p>I'm trying to create a Program in <code>Gtk3+</code>. 
  However, I can't work out how to call my <code>Gtk.SpinButton</code> value to use to drive the number of actions to perform later in the code (not written yet). </p>
  
  <p>The class <code>initiate()</code> at the end of the code is where I will execute commands based on the number entered in <code>gtk.spinbutton</code>.
  For now, I have left a simple print command so that I can tell when my code is working properly. </p>
  
  <p>Apologies if I'm sharing too much code, I don't know how else to show my problem properly without sharing all of it. </p>
  
  <pre><code>import gi
  gi.require_version("Gtk", "3.0")
  from gi.repository import Gtk
  import threading
  
  class MainWindow(Gtk.Window):
  
          def __init__(self):
                  Gtk.Window.__init__(self, title="My App")
                  self.set_default_size(100, 100)
                  self.set_border_width(10)
  
                  #box
                  self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=100)
                  self.add(self.box)
  
                  #label
                  label = Gtk.Label()
                  label.set_text("Welcome to My App!")
                  self.box.pack_start(label, True, True, 0)
  
                  #Number of files too rename
                  self.renamenum = Gtk.SpinButton()
                  self.box.pack_start(self.renamenum, True, True, 0)
                  numfiles = self.renamenum.get_value();
  
                  #Button1
                  self.button1 = Gtk.Button(label="Start")
                  self.button1.connect("clicked", self.button1_clicked)
                  self.box.pack_end(self.button1, True, True, 0)
  
          def button1_clicked(self, widget):
                  dialog = PopUp(self)
                  response = dialog.run()
                  if response == Gtk.ResponseType.CANCEL:
                          dialog.destroy()
                          Gtk.main_quit()
                  else:
                          pass
  
  class PopUp(Gtk.Dialog):
  
          def __init__(self, parent):
                  Gtk.Dialog.__init__(self, "Renaming Files", parent, 
  Gtk.DialogFlags.MODAL, (
                          "Cancel", Gtk.ResponseType.CANCEL
                  ))
                  self.set_default_size(500, 500)
                  self.set_border_width(50)
  
                  area = self.get_content_area()
                  area.add(Gtk.Label("Running..."))
                  self.show_all()
  
                  initiate()
  
  class initiate(MainWindow):
  
          def __init__(self):
                  self.var1 = MainWindow()
                  num = int(self.var1.numfiles)
                  print (numfiles)
  
  window = MainWindow()
  window.connect("delete-event", Gtk.main_quit)
  window.show_all()
  Gtk.main()
  </code></pre>
  
  <p>Expected results I want is for the number entered into the <code>gtk.spinbutton</code>, to be printed too the terminal. Instead, I get this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test4.py", line 33, in button1_clicked
      dialog = PopUp(self)
    File "test4.py", line 54, in __init__
      initiate()
    File "test4.py", line 60, in __init__
      num = int(self.var1.numfiles)
  AttributeError: 'MainWindow' object has no attribute 'numfiles'
  </code></pre>