What about this:

import gobject

self.color_cycle_timeout_id = 
gobject.timeout_add(500,self.color_cycle_timeout())

Does it helps?

Petr

Lion Chen píše v Pá 06. 04. 2012 v 23:03 +0800:
> Hello all,  i have a question:
> 
> when i check gtk_time_out in the gtk+2 reference, it said " gtk_timeout_add 
> has been deprecated since version 2.4 and should not be used in newly-written 
> code. Use g_timeout_add() instead."
> 
> but i don't know how to use the g_timout_add() function. if i use the 
> function, i would get an error message:
> 
> self.color_cycle_timeout_id = g_timeout_add(500, self.color_cycle_timeout())
> 
> Traceback (most recent call last):
>   File "/home/lionchen/workspace/testtext/testtext_bak.py", line 296, in 
> set_colors
>     self.color_cycle_timeout_id = g_timeout_add(500, 
> self.color_cycle_timeout())
> NameError: global name 'g_timeout_add' is not defined
>  
> or:
> 
> self.color_cycle_timeout_id = gtk.g_timeout_add(500, 
> self.color_cycle_timeout())
> 
> Traceback (most recent call last):
>   File "/home/lionchen/workspace/testtext/testtext_bak.py", line 296, in 
> set_colors
>     self.color_cycle_timeout_id = gtk.g_timeout_add(500, 
> self.color_cycle_timeout())
> AttributeError: 'module' object has no attribute 'g_timeout_add'
> 
> when i use the gtk.timeout_add(), no error message occurse.
> 
> can i use g_timeout_add() in pygtk?
> 
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/


_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to