title: How to get gobject.idle_add() to pass a parameter by reference?
body: <p>I have two threads in my PyGTK app:</p>
  
  <ul>
  <li>the main thread which runs the GTK loop and does all the GUI stuff</li>
  <li>another thread which handles network requests, etc.</li>
  </ul>
  
  <p>I need to have the second thread get some information from the first thread, so I call:</p>
  
  <pre><code>variable = None
  gobject.idle_add( function_in_main_thread, variable )
  </code></pre>
  
  <p>In the main thread I have:</p>
  
  <pre><code>def function_in_main_thread( variable ):
      variable = 1
  </code></pre>
  
  <p>The problem is that the variable in the second thread never gets set. It's value remains at <code>None</code>. So how can I get the main thread to actually <em>modify</em> the variable in the other thread?</p>
  
  <p><strong>Note:</strong> I have some thread synchronization code in the script in case anyone is concerned about modifying variables in other threads. I omitted it from this example because I felt it really didn't apply to the real issue.</p>