[Tutor] [tutor] threading problem in GUI

nephish nephish at xit.net
Wed Sep 7 22:09:20 CEST 2005


Pierre Barbier de Reuille wrote:

>nephish a écrit :
>  
>
>>one more thing.
>>if i uncomment the lines
>>gtk.threads_enter()
>>and
>>gtk.threads_leave()
>>the whole thing locks up when the function is called.
>>the gui, and the thread both lock up.
>>    
>>
>
>Well, that's just normal. However, what you should do is to send a
>signal from your thread with the text to append in your textbuffer.
>Then, you catch the signal in your main widget to show it !
>
>To emit a signal use :
>
>    gtk.gdk.threads_enter()
>    self.emit("writing", str)
>    gtk.gdk.threads_leave()
>
>To catch it:
>
>
>    emitting_object.connect("writing", self.method_handling_to_signal)
>
>Well, I used that and it just work ! Using the signal does not solve any
>threading problem but allow you to separate between the event and the
>answer to the event, which is a good habit to take !
>
>Pierre
>
>
>  
>
I finally got it working !!
thanks so much for all your help
i would not have gotten it working without you,
(or this mailing list)

God bless
shawn


More information about the Tutor mailing list