title: Python GTK: How to make it so a checkbox determines if a window will open or not
body: <p>In my program I have one of those annoying popups that alerts the user to go check the settings. I have a checkbox that if checked, is supposed to never show the popup again. I have no idea how to do that. When the check box is checked I need the program to write to a text file called tog_file.txt saying "true". And if the text in tog_file.txt says true, the popup will never display again.
  Code:</p>
  
  <pre><code>def reminder():
      global tog
      tog = open("tog_file.txt", "r+b")
      tog_r = tog.read()
      if tog_r == "true":
          print "true"
      if tog_r == "":
          global reminder
          reminder = gtk.Window(gtk.WINDOW_TOPLEVEL)
          reminder.set_position(gtk.WIN_POS_CENTER)
          reminder.set_size_request(450, 205)
          reminder.set_title("Info")
  
          textbox = gtk.Label("Remember To Go Into The Settings Menu! There are Important Settings that Need to be Reviewed by you!")
          textbox.set_justify(gtk.JUSTIFY_CENTER) 
          textbox.set_line_wrap(True)   
  
          button = gtk.Button("Close")
          button.connect("clicked", reminder_close)
  
          toggle = gtk.CheckButton("Don't Show This Message Again")
          item_text = toggle.get_active()
          if item_text == False:
              print "no"
          if item_text == True:
              print "yea"
              tog.write("true")
  
          fixed = gtk.Fixed()
          fixed.put(button, 300, 160)
          fixed.put(toggle, 50, 165)
          fixed.put(textbox, 50, 50)
  
          reminder.add(fixed)
          reminder.show_all()
  
  def reminder_close(self):
      reminder.destroy()
  </code></pre>
  
  <p>If you need any additional information, just post a comment.
  Thanks StackOverflow :)</p>