Re: I have a little problem with gtkmm and threads



On Mon, 21 Aug 2006 12:05:10 -0500
"Cesar Flores" <cesar7 gmail com> wrote:
> Excume for my bad english

Excume too ;)

>  The problem is that when i want run the window with Gtk::Main::run(window)
> my code stop until I close the window. Then my window don't present any
> result. And the thing that I want is that my window runs without stop my
> principal code.

So, i did't this in C/C++ code, but only in python gtk wrapper. And If
you want using system threads when main loop is running, you must call 
gdk_threads_init (void) function from C library, before you call Gtk::Main().
When u need in thread accessing to gtk widgets (like change label for example),
you must call gdk_threads_enter(void) before it and gdk_threads_leave(void)
after it. I don't find c++ wraps for this function, but probably, there is no
reason to make it :)

And there is Glib::Thread class, but i don't know it.

-- 
Ondrej Tuma

Unix-like system is the best operation system from the top of the world.
I'm lucky BSD and linux user. :) Use unix-like, be free. :)

www.blackmouse.biz       www.radioakropolis.cz            hash.webjet.cz
ICQ: 107760454          JABBER: mcbig jabber cz   MSN: ondra tu atlas cz



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]