gnope php gtk gui gnope.org  

Splash Screen

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
thomas-worm



Joined: 12 Jan 2006
Posts: 18
Location: Erlangen, Bavaria, Germany

PostPosted: Sat Feb 11, 2006 6:29 pm    Post subject: Splash Screen Reply with quote

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

PostPosted: Sun Feb 12, 2006 12:53 pm    Post subject: Re: Splash Screen Reply with quote

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

PostPosted: Sun Feb 12, 2006 1:19 pm    Post subject: Reply with quote

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

PostPosted: Sun Feb 12, 2006 1:24 pm    Post subject: Reply with quote

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

PostPosted: Sun Feb 12, 2006 4:38 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.