[Tutor] How to use g_timeout_add () function?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Tutor] How to use g_timeout_add () function?

Lion Chen
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 tu use the g_timout_add() function:
my_id = g_timeout_add(500, myfunction())

or:

my_id = gtk.g_timeout_add(500, myfunction())

everytime i run the program, it prompted me a message like modules do not have g_timeout_add() attribute.

so i still have to use gtk_timeout_add....

anybody help me?

Lion Chen

_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Reply | Threaded
Open this post in threaded view
|

Re: [Tutor] How to use g_timeout_add () function?

Evert Rol
> 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 tu use the g_timout_add() function:
> my_id = g_timeout_add(500, myfunction())
>
> or:
>
> my_id = gtk.g_timeout_add(500, myfunction())
>
> everytime i run the program, it prompted me a message like modules do not have g_timeout_add() attribute.

Although the error is reasonably clear, it's always good to specify the whole traceback (copy-paste it). It could show other (non)obvious mistakes.

If your module does not have g_timeout_add, then either your module is old, or it is in another (sub)module. You would have to search the documentation for the latter.
You actually don't say whether the above statement comes from the GTK2 documentation, or the pygtk documentation; I would assume the latter, since that makes more sense. But if the former, GTK and PyGTK may not be 100% in sync.


> so i still have to use gtk_timeout_add....
>
> anybody help me?


PyGTK has its own mailing list (and even an IRC channel), which may be more practical in this specific case. Have a look over there: http://www.pygtk.org/feedback.html

Cheers,

  Evert


_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Reply | Threaded
Open this post in threaded view
|

Re: [Tutor] How to use g_timeout_add () function?

Mark Lawrence
In reply to this post by Lion Chen
On 06/04/2012 15:17, Lion Chen wrote:

> 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 tu use the g_timout_add() function:
> my_id = g_timeout_add(500, myfunction())
>
> or:
>
> my_id = gtk.g_timeout_add(500, myfunction())
>
> everytime i run the program, it prompted me a message like modules do
> not have g_timeout_add() attribute.
>
> so i still have to use gtk_timeout_add....
>
> anybody help me?
>
> Lion Chen
>
> _______________________________________________
> Tutor maillist  -  [hidden email]
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

It's much easier for us to help if you provide an exact snippet of code
that reproduces the problem with the error message cut and pasted.
Having said that there's nothing to stop you using gtk_timeout_add as
it's only deprecated, i.e. it's been marked for removal at some time in
the future.

--
Cheers.

Mark Lawrence.

_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Reply | Threaded
Open this post in threaded view
|

Re: [Tutor] How to use g_timeout_add () function?

Mark Lawrence
In reply to this post by Lion Chen
Please don't top post and please reply to the list

Top posting fixed.

----- Forwarded Message -----
From: Lion Chen <[hidden email]>
To: Mark Lawrence <[hidden email]>
Cc:
Sent: Friday, 6 April 2012, 16:43
Subject: Re: [Tutor] How to use g_timeout_add () function?

fixed top posting

 > On 06/04/2012 15:17, Lion Chen wrote:
 >> 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 tu use the g_timout_add() function:
 >> my_id = g_timeout_add(500, myfunction())
 >>
 >> or:
 >>
 >> my_id = gtk.g_timeout_add(500, myfunction())
 >>
 >> everytime i run the program, it prompted me a message like modules do
 >> not have g_timeout_add() attribute.
 >>
 >> so i still have to use gtk_timeout_add....
 >>
 >> anybody help me?
 >>
 >> Lion Chen
 >>
 >> _______________________________________________
 >> Tutor maillist  -  [hidden email]
 >> To unsubscribe or change subscription options:
 >> http://mail.python.org/mailman/listinfo/tutor
 >
 > It's much easier for us to help if you provide an exact snippet of
 > code that reproduces the problem with the error message cut and
 > pasted. Having said that there's nothing to stop you using
 > gtk_timeout_add as it's only deprecated, i.e. it's been marked for
 > removal at some time in the future.
 >

the problem is solved.
in Python,  should use gobject.timeout_add() replace the g_timeout_add()
g_timeout_add() is for c.

--
Cheers.

Mark Lawrence.


_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor