By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

Wrapping functions in modules or packages.

P: n/a
I'm writing some utilty functions for use with gtk. But
in order to use them correctly I have to know whether
they are called in the gtk-thread or an other.

So my idea was to wrap the gtk.main function so that
it would registrate the thread_id that called it.

So I was thinking about doing something like the
import gtk

import thread

_gtkmain = gtk.main
def main():

global _gtkthread

_gtk_thread = thread.get_ident()
gtk.main = main
Is this acceptable? Are there better ways to do things like
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.