| View previous topic :: View next topic |
| Author |
Message |
thomas-worm
Joined: 12 Jan 2006 Posts: 18 Location: Erlangen, Bavaria, Germany
|
Posted: Sat Feb 11, 2006 6:29 pm Post subject: Splash Screen |
|
|
I've a splash window in my application. But how can I tell PHP-GTK to redraw a label (for loading status) immediatelly without pending_events or wait until the main method of PHP-GTK gets idle?
I tried with pending_events but then my Main Window appears thousand times because i call pending_events in the constructor of my Main Window!
Which ways to create a splash window do you use? |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Sun Feb 12, 2006 12:53 pm Post subject: Re: Splash Screen |
|
|
| thomas-worm wrote: | | But how can I tell PHP-GTK to redraw a label (for loading status) immediatelly without pending_events |
You have to use
| Code: | | while(Gtk::events_pending()) { Gtk::main_iteration();} |
That is because all screen updates to be done are queued by gtk, and only the main iteration is able to execute them.
So if you want to show/update the splash but not show your window, you shouldn't set your main window visible. Let it be hidden until you can hide your splash screen, and it'll be fine. |
|
| Back to top |
|
 |
thomas-worm
Joined: 12 Jan 2006 Posts: 18 Location: Erlangen, Bavaria, Germany
|
Posted: Sun Feb 12, 2006 1:19 pm Post subject: |
|
|
| Thanks! But I've the problem that if I use your code the Main Window object is created indefinite times because I call your code in the constructor function of that Window. Is there any example code of splash screens available on the internet? |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Sun Feb 12, 2006 1:24 pm Post subject: |
|
|
| thomas-worm wrote: | | the Main Window object is created indefinite times because I call your code in the constructor |
That's really weird, but shouldn't happen. Did you call the parent constructor first?
And can you reduce your code to the minimum with keeping the behavior you describe and post it here? |
|
| Back to top |
|
 |
thomas-worm
Joined: 12 Jan 2006 Posts: 18 Location: Erlangen, Bavaria, Germany
|
Posted: Sun Feb 12, 2006 4:38 pm Post subject: |
|
|
Oh... I made a mistake in my code... Now all is working fine. Thank you!
P.S.: I try to code an office suite in PHP-GTK2. When it's complete I'll release it on your channel!
Best Regards and many thanks! Thomas |
|
| Back to top |
|
 |
|