Revision history for gtkdialogDocTips9.15
Additions:
[[HomePage]] > [[SoftwareIndex|Software Index]] > [[SoftwareDevelopment|Development]] > [[gtkdialog|gtkdialog]] > [[gtkdialogDocTips|Tips and Tricks]]
===@@**#%[[gtkdialogDocTips9.14|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.16|Next ❱❱❱]]#%**@@===
===@@**#%[[gtkdialogDocTips9.14|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.16|Next ❱❱❱]]#%**@@===
Deletions:
@@**#%[[gtkdialogDocTips9.14|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.16|Next ❱❱❱]]#%**@@
Additions:
====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]]
@@**#%[[gtkdialogDocTips9.14|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.16|Next ❱❱❱]]#%**@@
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]]
@@**#%[[gtkdialogDocTips9.14|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.16|Next ❱❱❱]]#%**@@
Deletions:
This example shows how to add an image beside the label of a checkbox. Be aware that this technique only works for gtk stock-items.
<checkbox use-stock="true" label="gtk-fullscreen" image-position="1" tooltip-text="checkbox derives from button ...">
</checkbox>
<button use-stock="true" label="gtk-quit">
</button>
@@**#%[[gtkdialogDocTips9.13|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.15|Next ❱❱❱]]#%**@@