title: How to close 1st window after opening 2nd window in pygtk
body: <p>In my pygtk app, I want to close current window after opening next window. </p>
  
  <p>this is the code which i have written</p>
  
  <pre><code>#!/usr/bin/env python
  
  # example base.py
  
  import pygtk
  pygtk.require('2.0')
  import gtk
  import subprocess
  
  class Base:
      def next(self,widget):
          subprocess.call('fabfile.py', shell=True)
          self.window.destroy()
  
      def __init__(self):
          self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
          self.window.set_size_request(200,200)
          self.button = gtk.Button("Hello World")
          self.button.show()
          self.button.connect("clicked", self.next)
          self.window.add(self.button)
          self.window.show()
  
      def main(self):
          gtk.main()
  
  print __name__
  if __name__ == "__main__":
      base = Base()
      base.main()
  </code></pre>
  
  <p>when I click on <code>next</code> button it opens next window but it does not close my current window in background and current window go to hang in background after opening next window.</p>
  
  <pre><code>def next(self,widget):
     subprocess.call("scan.py", shell=True)
     self.win.destroy()
  </code></pre>
  
  <p>when i run this code in <code>window machine</code> it is not closing existing window and when i run in <code>Linux machine</code> it is giving this error.</p>
  
  <p><code>/bin/sh: fabfile.py: command not found</code></p>
  
  <p>Anyone let me know how to do this.
  Thanks...</p>