HomePage > Software Index > Development > gtkdialog > Tips and Tricks

9.15 Use a splash screen


A splash screen could be useful if the startup time is increasing. The delay may occur for 2 reasons. There are several startup processes, or the gtkdialog code is heavy. The latter case makes it necessary to close the splash-window first when the main window is drawn on screen. We use the <window> signal show to determine when the splash should be closed.

#Splash
echo 0 > /tmp/splash
export SPLASH='
<window title="PCC" icon-name="gtk-preferences" resizable="false" decorated="false">'"
<vbox>
 <pixmap><input file>/usr/share/midi-icons/configuration48.png</input></pixmap>
 <text height-request=\"50\" use-markup=\"true\"><label>\"<b><span size='"'x-large'"' color='"'orange'"'>Puppy Control Center</span></b>\"</label></text>"'
 <progressbar visible="false">
  <label>nn</label>
  <input>while [ "$M" != "100" ]; do M=`cat /tmp/splash`; echo $M; usleep 500000; done</input>
  <action type="exit">Ready</action>
 </progressbar>
</vbox></window>'
gtkdialog -p SPLASH --center &

sleep 2 #well, this is to simulate some startup processes....

export GUI='
<window title="PCC" icon-name="gtk-preferences" width-request="800">
<vbox>
  <text height-request="200">
   <label>Hello, welcome to the Puppy Control Center</label>
  </text>
  <hbox>
	<button ok></button>
  </hbox>
</vbox>
 <action signal="show">echo 100 > /tmp/splash</action>
</window>'

gtkdialog -p GUI


Mave has made an attempt to replace yaf-splash using gtkdialog. Yaf-splash doesn't support UTF-8, and has given some issues when translation to some languages. Read more at http://www.murga-linux.com/puppy/viewtopic.php?p=422343#422343



Categories
CategoryGtkdialog
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki