Posted: Sun May 04, 2008 7:09 pm Post subject: Intro window
Hi,
what is the best way how to make an "intro window"?
More precisely, I have an image I would like to show before main window for 10 seconds. It's png format and I would like only the image and not the whole window to be showed. How can I do that?
1. Make a new window
2. put a GtkImage on it
3. make sure the GtkImage is your png (I use anjuta so I do it in the IDE)
4. set the propriety of your window correctly, i.e.
set the type_hint of the window to GDK_WINDOW_TYPE_HINT_SPLASHSCREEN
since what you want is a splash screen.
5. in your main, add:
gtk_widget_show(window_10_sec);
g_timeout_add (10000, function_to_call, windows_10_sec);
Joined: 21 Sep 2005 Posts: 427 Location: Portland, OR USA
Posted: Mon May 05, 2008 7:22 pm Post subject:
Also, as a usability note, sometimes a splash screen is annoying. You should allow users to disable it in the preferences for you application.
If you are using a splash screen because your application is loading a lot of data which takes significant time, you don't need a timeout function to display it. Instead, display the splash screen window as the first thing in your app, and then destory it once everything has loaded (after all other routines).
Thanks a lot. It works perfectly. Just one thing - on the image is logo and the background is transparent - can I somehow keep the transparency of the image?