Posted: Thu 23 Jun 2011, 22:16
Sizzling
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
It Tested out perfectly in 431 ...Great work!
Thank you muchly,
s
(oops, sorry, forgot to check dice-roller)
![Smile :)](./images/smilies/icon_smile.gif)
READ-ONLY Archive
https://oldforum.puppylinux.com/
Sizzling
Code: Select all
<pixmap>
<input command>jhead -st - /24543.jpg</input>
</pixmap>
disciple,disciple wrote:Hi guys,
Do you have any idea if it would be feasible to enable gtkdialog to display an image from standard input (perhaps I'm not using this term correctly - see my explanation below)?
Here's a simple example of what I mean:
If a jpeg file has an exif thumbnail I can use the jhead command to extract this to a file. I can also extract it to standard output (-) like this `jhead -st - /24543.jpg`
So do you think it would be possible to enable the use of something like this?:Don't worry, I'm not thinking of writing a gtkdialog gui for all the command line image editors... although that would be interestingCode: Select all
<pixmap> <input command>jhead -st - /24543.jpg</input> </pixmap>
Code: Select all
<pixmap>
<input file>$(jhead -st - /24543.jpg)</input>
</pixmap>
Code: Select all
#!/bin/sh
# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.
GTKDIALOG=gtkdialog
function funcentCreate() {
for ((f = $1; f < $2; f++)); do
echo '<entry editable="false"><default>"'$f'"</default></entry>'
done
}
export MAIN_DIALOG='
<window title="hbxScrolledWindow" resizable="false">
<vbox>
<frame hbox widget scrolled window functionality>
<hbox>
<hbox width-request="200" height-request="200">
<hbox scrollable="true">
'"$(funcentCreate 0 10)"'
</hbox>
</hbox>
<hbox width-request="400" height-request="200">
<hbox scrollable="true" width-request="500">
'"$(funcentCreate 0 10)"'
</hbox>
</hbox>
</hbox>
<hbox>
<hbox width-request="400" height-request="200">
<hbox scrollable="true" height-request="500">
'"$(funcentCreate 0 10)"'
</hbox>
</hbox>
<hbox width-request="200" height-request="200">
<hbox scrollable="true" width-request="500" height-request="500">
'"$(funcentCreate 0 10)"'
</hbox>
</hbox>
</hbox>
</frame>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --center --program=MAIN_DIALOG
Code: Select all
#!/bin/sh
# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.
GTKDIALOG=gtkdialog
function funcentCreate() {
for ((f = $1; f < $2; f++)); do
echo '<entry editable="false"><default>"'$f'"</default></entry>'
done
}
export MAIN_DIALOG='
<window title="vbxScrolledWindow" resizable="false">
<vbox>
<frame vbox widget scrolled window functionality>
<hbox>
<vbox scrollable="true" width="200" height="200">
'"$(funcentCreate 0 10)"'
</vbox>
<vbox scrollable="true" width-request="500" width="400" height="200">
'"$(funcentCreate 0 10)"'
</vbox>
</hbox>
<hbox>
<vbox scrollable="true" height-request="500" width="400" height="200">
'"$(funcentCreate 0 10)"'
</vbox>
<vbox scrollable="true" width-request="500" height-request="500" width="200" height="200">
'"$(funcentCreate 0 10)"'
</vbox>
</hbox>
</frame>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --center --program=MAIN_DIALOG
Hi 01micko01micko wrote:...dice roller app...
No, it doesn't work.seaside wrote:disciple,disciple wrote:Hi guys,
Do you have any idea if it would be feasible to enable gtkdialog to display an image from standard input (perhaps I'm not using this term correctly - see my explanation below)?
Here's a simple example of what I mean:
If a jpeg file has an exif thumbnail I can use the jhead command to extract this to a file. I can also extract it to standard output (-) like this `jhead -st - /24543.jpg`
So do you think it would be possible to enable the use of something like this?:Don't worry, I'm not thinking of writing a gtkdialog gui for all the command line image editors... although that would be interestingCode: Select all
<pixmap> <input command>jhead -st - /24543.jpg</input> </pixmap>
I think this could work. I don't have jhead, so can't check.
Cheers,Code: Select all
<pixmap> <input file>$(jhead -st - /24543.jpg)</input> </pixmap>
s
Yes, I like to avoid using temporary files where possible.01micko wrote:Hi disciple.
It seems stdout from jhead can't be accepted. I suppose you know it works if you redirect to a file and point <pixmap> to that file, but not what you were hoping for.
Code: Select all
#!/bin/sh
# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.
GTKDIALOG=gtkdialog
function funchspCreate() {
for ((f = 0; f < $1; f++)); do
echo '<hseparator width-request="'$2'"></hseparator>'
done
}
function funcvspCreate() {
for ((f = 0; f < $1; f++)); do
echo '<vseparator height-request="'$2'"></vseparator>'
done
}
export MAIN_DIALOG='
<window title="sepSeparators" resizable="false">
<vbox>
<frame hseparator and vseparator widgets>
<hbox>
<hbox>
'"$(funcvspCreate 30 200)"'
</hbox>
<vbox>
'"$(funchspCreate 34 400)"'
</vbox>
</hbox>
<hbox>
<vbox>
'"$(funchspCreate 34 400)"'
</vbox>
<hbox>
'"$(funcvspCreate 30 200)"'
</hbox>
</hbox>
</frame>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --center --program=MAIN_DIALOG
Code: Select all
#!/bin/sh
# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.
GTKDIALOG=gtkdialog
function funcbtnCreate() {
echo '<button>
<label>"'"$2"'"</label>
<action>echo "'"$3"' cboComboBox'$1'"</action>
<action type="'"$4"'">cboComboBox'$1'</action>
</button>'
}
function funccboCreate() {
if [ $1 = 0 ]; then
echo '<combobox>'
elif [ $1 = 1 ]; then
echo '<combobox allow-empty="false" value-in-list="true">'
elif [ $1 = 2 ]; then
echo '<combobox case-sensitive="true" value-in-list="true">'
fi
echo '<variable>cboComboBox'$1'</variable>
<visible>enabled</visible>
<item>cboComboBox'$1'</item>'
if [ $1 = 0 ]; then
echo '<item>tag attributes none</item>'
elif [ $1 = 1 ]; then
echo '<item>tag attribute allow-empty="false"</item>
<item>tag attribute value-in-list="true"</item>'
elif [ $1 = 2 ]; then
echo '<item>tag attribute case-sensitive="true"</item>
<item>tag attribute value-in-list="true"</item>'
fi
echo '</combobox>
<hbox homogeneous="true">
'"$(funcbtnCreate $1 Clear Clearing clear)"'
'"$(funcbtnCreate $1 Refresh Reloading refresh)"'
</hbox>'
if [ $1 -lt 2 ]; then echo '<hseparator></hseparator>'; fi
}
function funccboTextCreate() {
if [ $1 = 0 ]; then
echo '<comboboxtext accept="filename">'
elif [ $1 = 1 ]; then
echo '<comboboxtext accept="filename" active="4" button-sensitivity="1">'
elif [ $1 = 2 ]; then
echo '<comboboxtext accept="filename" focus-on-click="false">'
fi
echo '<variable>cboComboBoxText'$1'</variable>
<visible>enabled</visible>
<item>cboComboBoxText'$1'</item>
<item>tag attribute accept="filename"</item>'
if [ $1 = 1 ]; then
echo '<item>tag attribute active="4"</item>
<item>tag attribute button-sensitivity="1"</item>'
elif [ $1 = 2 ]; then
echo '<item>tag attribute focus-on-click="false"</item>'
fi
if [ $1 -gt 0 ]; then
echo '<item>This is the default directive text but the active index will override it if declared</item>
<default>This is the default directive text but the active index will override it if declared</default>'
fi
echo '<input>echo "This came from a shell command"</input>
<input file>inputfile</input>
<output file>outputfile</output>
<action signal="changed">echo "cboComboBoxText'$1' changed to $cboComboBoxText'$1'"</action>
<action>echo "cboComboBoxText'$1' action for default signal triggered"</action>
<action type="command">echo "cboComboBoxText'$1' action type for default signal triggered"</action>
</comboboxtext>
<hbox homogeneous="true">
'"$(funcbtnCreate Text$1 Clear Clearing clear)"'
'"$(funcbtnCreate Text$1 Delete Deleting removeselected)"'
'"$(funcbtnCreate Text$1 Refresh Reloading refresh)"'
'"$(funcbtnCreate Text$1 Save Saving save)"'
</hbox>
<hbox homogeneous="true">
'"$(funcbtnCreate Text$1 Disable Disabling disable)"'
'"$(funcbtnCreate Text$1 Enable Enabling enable)"'
'"$(funcbtnCreate Text$1 Fileselect """Inserting into""" fileselect)"'
</hbox>'
if [ $1 -lt 2 ]; then echo '<hseparator></hseparator>'; fi
}
if [ ! -f inputfile ]; then
echo "This came from an input file" > inputfile
fi
export MAIN_DIALOG='
<window title="cboComboBoxText" resizable="false">
<vbox>
<hbox>
<frame combobox widget (deprecated)>
<vbox>
'"$(funccboCreate 0)"'
'"$(funccboCreate 1)"'
'"$(funccboCreate 2)"'
</vbox>
</frame>
<frame comboboxtext widget>
<vbox width-request="300">
'"$(funccboTextCreate 0)"'
'"$(funccboTextCreate 1)"'
'"$(funccboTextCreate 2)"'
</vbox>
</frame>
</hbox>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --center --program=MAIN_DIALOG
Code: Select all
<input memvar>$mypic</input>
Code: Select all
export mypic=`cat mypic.png`
Code: Select all
export mypic=`hexdump -ve '1/1 "%.2x"' mypic.png`
It would be nice to see a work around, I agree... Hopefully the GTK version required will not climb too much, although I guess it will, as needs must..01micko wrote:Seems `gtk_widget_get_realized' isn't introduced until gtk+-2.20 so the latest revision fails to compile in Puppy-431. (gtk+-2.14)
Any work around possible?
You're welcome. Storing binary files in shell variables is noted.vovchik wrote:Thanks a million. The glade problem is fixed! And the new combotext widget is great. I am now revising scripts to take advantage of it.
Yep, implemented and committed01micko wrote:Seems `gtk_widget_get_realized' isn't introduced until gtk+-2.20 so the latest revision fails to compile in Puppy-431. (gtk+-2.14)
Any work around possible?
I'm interested in Artistic projection displays, possibly dynamicExploring how audiovisual technology can be used to transform, create, expand, amplify and interpret physical spaces.