Wiki source for gtkdialogDocTips9.6
[[HomePage]] > [[SoftwareIndex|Software Index]] > [[SoftwareDevelopment|Development]] > [[gtkdialog|gtkdialog]] > [[gtkdialogDocTips|Tips and Tricks]]
====9.6 Refresh image====
Gtkdialog can refresh an image in a ##<pixmap>## widget without restarting the gui. Since the ##<input file>## is static, we must change its content (by copy another file), and then refresh.
%%(language-ref)
export MAIN='
<window>
<pixmap>
<variable>IMAGE</variable>
<input file>/root/image1.png</input>
</pixmap>
<button>
<label>Change image</label>
<action>cp -f /root/image2.png /root/image1.png</action>
<action type="refresh">IMAGE</action>
</button>
</window>'
gtkdialog --center --program=MAIN
%%
===@@**#%[[gtkdialogDocTips9.5|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.7|Next ❱❱❱]]#%**@@===
----
==Categories==
CategoryGtkdialog
====9.6 Refresh image====
Gtkdialog can refresh an image in a ##<pixmap>## widget without restarting the gui. Since the ##<input file>## is static, we must change its content (by copy another file), and then refresh.
%%(language-ref)
export MAIN='
<window>
<pixmap>
<variable>IMAGE</variable>
<input file>/root/image1.png</input>
</pixmap>
<button>
<label>Change image</label>
<action>cp -f /root/image2.png /root/image1.png</action>
<action type="refresh">IMAGE</action>
</button>
</window>'
gtkdialog --center --program=MAIN
%%
===@@**#%[[gtkdialogDocTips9.5|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.7|Next ❱❱❱]]#%**@@===
----
==Categories==
CategoryGtkdialog