Re: how to display initial information of program




On 22/06/11 14:24, jh_wang2004 wrote:
Hello Bill:
Thanks a lot for you answer, i'm new to GTK indeed£¬and please forgive
my poor English.
Maybe I did not clearly express the intent.
My app display a login dialog at first, when user clicks button, it
connects database, after connection established,
it destroy login dialog, then build GIOChannel , enroll some timeout
callbcak function,initial video compression card's four channel etc.,
after these have been done, shows main window and enter mainloop.
I want to display these message before main window shows, because it
is relatively time-consuming.

What you want to do is to arrange everything around the mainloop:

1. Show the login dialog.

2. start mainloop.

3. Accept user login and start doing database stuff, video stuff in a callback of the login dialog. You could also show a progress window before doing the database stuff...

4. once the callback has done its work, hide the progress window and show the main window at the end of the callback function.

see, you enter main loop pretty early.

Normally, if you want to start something after the GUI is shown, you should use a idle_add() function to start your stuff in the callback, before the main loop is called. Then the idled callback will be called once the mainloop start running and the GUI is shown.


Maybe i shall use gtkprogressbar, but i can't refresh it using timeout
function, for it didn't enter mainloop at that time,
so i intend to display those message by using a bolderless window
container, i don't know how to realize that.
Can you give me some tips?




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