Re: [pygtk] Threads in GTK, yet another doubt about this mistery

2007-04-25 Thread Antoon Pardon
Sorry for my rather late answer.

On Tue, Mar 27, 2007 at 08:02:31PM -0300, Gabriel Falcão wrote:
 Hello friends!
 
 Everytime a check any program that use gtk threading i see the use of
 gobject threads init, locks, though threading.Thread before the gtk.main()
 
 But my doubt is: Why i never see the inverse?
 
 Why not put the gtk.main() inside a threading.Thread e do anything before
 this?
 I just want to know what are the problems when using it.

I don't think there are problems with it. I have one program where
gtk.main is started in a thread and it works without a problem.

It is a rather peculiar program though since it is a kind of
test suite for other GTK programs. It was the only time I
thought it usefull to have GTK started from a thread though.

-- 
Antoon Pardon
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Threads in GTK, yet another doubt about this mistery

2007-03-27 Thread Gabriel Falcão

Hello friends!

Everytime a check any program that use gtk threading i see the use of
gobject threads init, locks, though threading.Thread before the gtk.main()

But my doubt is: Why i never see the inverse?

Why not put the gtk.main() inside a threading.Thread e do anything before
this?
I just want to know what are the problems when using it.


I the  code below i demonstrate better what i want to say:

import gtk,sys
import threading
class GUI(threading.Thread):
def __init__(self):
threading.Thread.__init_ _(self)
self.gui=gtk
def run(self):
self.gui.main()

def quit(widget)
sys.exit(0)

win=gtk.Window()
win.set_default_size(200,200)
win.connect('destroy',sair)
text=gtk.Label(HELLO WORLD)
text.show()
win.add(texto)
win.show ()
#Starting the mainloop inside a thread
GUI().start()

text.set_markup(span size=\13000\HELLO THREADS!/span)


Então, por que não usar assim?
--
:wq

Atenciosamente
__
   Gabriel Falcão

Não há um caminho para o Linux, Linux é o caminho! 

Jabber: [EMAIL PROTECTED]
Blog: http://www.nacaolivre.org
GPG public key: http://www.nacaolivre.org/gabrielteratos.gpg

-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCA d-- s++: a--- C UL++ P+ L E- W++ N* o-- K- w---
O-- M+ V- PS+ PE++ Y+++ PGP++ t+ 5 X R+ tv-- b- DI-- D+++
G++ e+ h! r+++ y++
--END GEEK CODE BLOCK--

--
:wq

Atenciosamente
__
   Gabriel Falcão

Não há um caminho para o Linux, Linux é o caminho! 

Jabber: [EMAIL PROTECTED]
Blog: http://www.nacaolivre.org
GPG public key: http://www.nacaolivre.org/gabrielteratos.gpg

-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCA d-- s++: a--- C UL++ P+ L E- W++ N* o-- K- w---
O-- M+ V- PS+ PE++ Y+++ PGP++ t+ 5 X R+ tv-- b- DI-- D+++
G++ e+ h! r+++ y++
--END GEEK CODE BLOCK--
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/