Hi Saeed,<br><br>that works! thank you. =)<br><br>Lucas.<br><br><div class="gmail_quote">On Thu, Aug 27, 2009 at 1:09 PM, saeed <span dir="ltr">&lt;<a href="mailto:saeed.gnu@gmail.com">saeed.gnu@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Write  this two line when you want to update GUI, here write it in<br>
function status, or after calling it:<br>
        while gtk.events_pending():<br>
               gtk.main_iteration_do(False)<br>
<div class="im"><br>
<br>
<br>
def status(self, msg):<br>
        self.textbuffer_status.insert_at_cursor(&#39;%s \n&#39; % msg)<br>
        self.textview_status.scroll_to_mark(self.textbuffer_status.get_insert(),<br>
0)<br>
</div>        while gtk.events_pending():<br>
               gtk.main_iteration_do(False)<br>
<div><div></div><div class="h5"><br>
<br>
On 8/27/09, Lucas Mocellin &lt;<a href="mailto:lucasmocellin@gmail.com">lucasmocellin@gmail.com</a>&gt; wrote:<br>
&gt; Hi folks,<br>
&gt;<br>
&gt; I made a GUI that when someone click on a button, it calls a function and do<br>
&gt; &quot;somethings&quot; and some of them is:<br>
&gt;<br>
&gt;             self.status(&#39;Estudante liberado para fazer a prova!&#39;)<br>
&gt;             self.status(&#39;Conectando ao servidor de Provas, Aguarde um<br>
&gt; momento por favor..&#39;)<br>
&gt;             for i in range(30):<br>
&gt;                 if (os.system(&#39;ip link show tun0&#39;) == 0):<br>
&gt;                     break<br>
&gt;                 if (i == 29):<br>
&gt;                     self.status(&#39;Erro na conexao com o servidor de provas,<br>
&gt; tente novamente.&#39;)<br>
&gt;                     return<br>
&gt;                 time.sleep(2)<br>
&gt;             self.status(&#39;Conexao realizada com sucesso.&#39;)<br>
&gt;             self.status(&#39;Abrindo Prova Online.&#39;)<br>
&gt;<br>
&gt; the self.status is a function which I created to show msg in the TextView:<br>
&gt;  def status(self, msg):<br>
&gt;         self.textbuffer_status.insert_at_cursor(&#39;%s \n&#39; % msg)<br>
&gt;<br>
&gt; self.textview_status.scroll_to_mark(self.textbuffer_status.get_insert(), 0)<br>
&gt; ------------------<br>
&gt; the problem is, the first 2 messages (self.status(*)) doesn&#39;t appear in the<br>
&gt; correct time, there is a great delay for them, you can notice that the &quot;for<br>
&gt; statement&quot; MAY late a minute, and when it happens, the first 2 messages only<br>
&gt; apeear AFTER this minute.. with the other 2 in the end.<br>
&gt;<br>
&gt; It looks like a &quot;refresh/flush&quot; problem, I tried &quot;gtk.gdk.flush()&quot;, but it<br>
&gt; didn&#39;t work out.<br>
&gt;<br>
&gt; any ideas?<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt;<br>
&gt; Lucas.<br>
&gt;             gtk.gdk.flush()<br>
&gt;<br>
</div></div></blockquote></div><br>