[pygtk] Question about "TextView" refresh

Lucas Mocellin lucasmocellin at gmail.com
Thu Aug 27 22:25:44 WST 2009


Hi folks,

I made a GUI that when someone click on a button, it calls a function and do
"somethings" and some of them is:

            self.status('Estudante liberado para fazer a prova!')
            self.status('Conectando ao servidor de Provas, Aguarde um
momento por favor..')
            for i in range(30):
                if (os.system('ip link show tun0') == 0):
                    break
                if (i == 29):
                    self.status('Erro na conexao com o servidor de provas,
tente novamente.')
                    return
                time.sleep(2)
            self.status('Conexao realizada com sucesso.')
            self.status('Abrindo Prova Online.')

the self.status is a function which I created to show msg in the TextView:
 def status(self, msg):
        self.textbuffer_status.insert_at_cursor('%s \n' % msg)

self.textview_status.scroll_to_mark(self.textbuffer_status.get_insert(), 0)
------------------
the problem is, the first 2 messages (self.status(*)) doesn't appear in the
correct time, there is a great delay for them, you can notice that the "for
statement" MAY late a minute, and when it happens, the first 2 messages only
apeear AFTER this minute.. with the other 2 in the end.

It looks like a "refresh/flush" problem, I tried "gtk.gdk.flush()", but it
didn't work out.

any ideas?

Thanks in advance,

Lucas.
            gtk.gdk.flush()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090827/c079e9eb/attachment-0001.htm 


More information about the pygtk mailing list