Revision history for gtkdialogDocTips9.13


Revision [33343]

Last edited on 2023-02-24 06:57:59 by zigbert
Additions:
[[HomePage]] > [[SoftwareIndex|Software Index]] > [[SoftwareDevelopment|Development]] > [[gtkdialog|gtkdialog]] > [[gtkdialogDocTips|Tips and Tricks]]
===@@**#%[[gtkdialogDocTips9.12|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.14|Next ❱❱❱]]#%**@@===
Deletions:
[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]] > [[gtkdialog gtkdialog]] > [[gtkdialogDocTips Tips and Tricks]]
@@**#%[[gtkdialogDocTips9.12|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.14|Next ❱❱❱]]#%**@@


Revision [32961]

Edited on 2020-08-04 21:34:40 by zigbert
Additions:
====9.13 MIME====
What should happen when the user double-clicks on an image-file in your gui. In some cases it is logical to show the image in an image-viewer... but it is no need of linking all kinds of extensions to different programs. - It is already done by the filebrowser. Puppy uses 'rox' and if you execute ##rox /path/image.png## the image will show up in the defined viewer. Just as simple as that.
@@**#%[[gtkdialogDocTips9.12|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.14|Next ❱❱❱]]#%**@@
Deletions:
====9.12 Let <entry> accept (some) numbers only====
The following example shows how to limit the user input to a ##<entry>##. Useful for 'all' kinds of settings.
%%(language-ref)
export MAIN_DIALOG='
<vbox>
<text>
<label>"Enter a number (text will default to 0)"</label>
</text>
<entry editable="true" allow-empty="false">
<input>case $ENTRY in ""|*[^0-9]*) echo 0;; *) echo $ENTRY ;; esac</input>
<variable>ENTRY</variable>
<action signal="focus-out-event">refresh:ENTRY</action>
</entry>
<text>
<label>"Enter a number within [5,15], otherwise:
input will be capped at 15,
floored at 5,
or set to 10 in case of text input"</label>
</text>
<entry editable="true" allow-empty="false">
<input>A=$ENTRY2; case $A in [0-9]*) [[ $A -gt 15 ]] && echo 15 || [[ $A -lt 5 ]] && echo 5 || echo $A ;; *) echo 10;; esac</input>
<variable>ENTRY2</variable>
<action signal="focus-out-event">refresh:ENTRY2</action>
</entry>
<button ok></button>
</vbox>'
gtkdialog -p MAIN_DIALOG
unset MAIN_DIALOG
%%
@@**#%[[gtkdialogDocTips9.11|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.13|Next ❱❱❱]]#%**@@


Revision [32960]

The oldest known version of this page was created on 2020-08-04 21:33:24 by zigbert
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki