Re: gtkmm window



luisjcollado <masmalo1 yahoo es> wrote:

Once the window were showed to the user, some code will be executed.
The problem here is that if I catch the signal win.signal_show, it is
catch before the main loop happened.

Chris Vine wrote:
I doubt that.  GTK+ events do not normally propagate until the main loop
is running.

I presume the following is happening: the code in your show() method is executed within the main loop. This show()-method returns
after all of your modules are loaded. In other words, you are
blocking the main loop. After all is done, the main loop can continue work and paint the window.

You could load all your modules in a designated thread, which sends messages to the main thread whenever it's done something. The function that receives these notifications can display progress.

An idle handler will do this for you, or if you want to indicate
progress, a timeout.

If you use the main thread to load your modules, the timeout will not be fired until your initialisation routine returns, i.e., when everything is done. Even if you break up initialisation into several atomic pieces, your application will be irresponsive while each of them runs.

Hope this helps,
Mark


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