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
Gtkdialog Development
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Good work thunor! You're making our dreams come true
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
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.
~~~
thunor,
Yes dice roller is posted here. It's ugly but it works.
I also just posted a simple memory game in the same topic.
The new scroll functionality looks interesting, Many apps could benefit from this.
Cheers
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.
~~~
thunor,
Yes dice roller is posted here. It's ugly but it works.
I also just posted a simple memory game in the same topic.
The new scroll functionality looks interesting, Many apps could benefit from this.
Cheers
Puppy Linux Blog - contact me for access
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.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Added hseparator and vseparator widgets
The hseparator widget reference is available here.
The vseparator widget reference is available here.
<hseparator> and <vseparator> widgets example:
Regards,
Thunor
The hseparator widget reference is available here.
The vseparator widget reference is available here.
<hseparator> and <vseparator> widgets example:
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
Thunor
Last edited by thunor on Fri 12 Aug 2011, 14:03, edited 2 times in total.
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Added comboboxtext widget
The widget reference is available here.
[EDIT] Updated 2011-07-02 14:21 to show the action and action type directives triggering for the default signal.
Added full action function type support which might've been overkill but I now know how to do it and can copy and paste my existing code to create new widgets.
I've managed the "changed" signal myself so that after initialisation you'll get one emission from any action function if the text has actually changed. The active="index" tag attribute gets applied after widget realization by GTK and it emits a "changed" signal itself.
The default directive will set the default based upon text, so there're two ways to set a default: by index or by text match.
Other things I've implemented are auto-selection of index 0 on initialisation which'll get overridden by the default directive or active tag attribute, auto-selection of the previous item (if possible) on deletion and the fileselect function inserts before the currently selected item. I made an effort to make this usable rather than just adding it and expecting application developers to work around it.
The entry version of this widget will follow after I've documented this one.
<comboboxtext> widget example:
Regards,
Thunor
The widget reference is available here.
[EDIT] Updated 2011-07-02 14:21 to show the action and action type directives triggering for the default signal.
Added full action function type support which might've been overkill but I now know how to do it and can copy and paste my existing code to create new widgets.
I've managed the "changed" signal myself so that after initialisation you'll get one emission from any action function if the text has actually changed. The active="index" tag attribute gets applied after widget realization by GTK and it emits a "changed" signal itself.
The default directive will set the default based upon text, so there're two ways to set a default: by index or by text match.
Other things I've implemented are auto-selection of index 0 on initialisation which'll get overridden by the default directive or active tag attribute, auto-selection of the previous item (if possible) on deletion and the fileselect function inserts before the currently selected item. I made an effort to make this usable rather than just adding it and expecting application developers to work around it.
The entry version of this widget will follow after I've documented this one.
<comboboxtext> widget example:
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
Thunor
Last edited by thunor on Fri 12 Aug 2011, 14:04, edited 4 times in total.
bew widgets
Dear thunor,
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.
With kind regards,
vovchik
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.
With kind regards,
vovchik
pixmaps
Dear thunor,
I was thinking about disciple's request for a memory read and think it would not be too difficult to implement another type of input for <pixmap>:
where mypic would be the result of a:
using gdk_pixbuf_new_from_data or gdk_pixbuf_new_from_inline (if converted to hexbytes first).
It's just an idea....
With kind regards,
vovchik
PS. I should have been more clear about the cat business. To avoid the newline and null byte problem with vars in bash, what about assuming a straight hex dump, e.g.:
and converting the dump for gdk_pixbuf_new_from_data. I have used gdk_pixbuf_new_from_data in different contexts and it works nicely.
I was thinking about disciple's request for a memory read and think it would not be too difficult to implement another type of input for <pixmap>:
Code: Select all
<input memvar>$mypic</input>
Code: Select all
export mypic=`cat mypic.png`
It's just an idea....
With kind regards,
vovchik
PS. I should have been more clear about the cat business. To avoid the newline and null byte problem with vars in bash, what about assuming a straight hex dump, e.g.:
Code: Select all
export mypic=`hexdump -ve '1/1 "%.2x"' mypic.png`
Last edited by vovchik on Sat 02 Jul 2011, 09:53, edited 1 time in total.
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?
Any work around possible?
Puppy Linux Blog - contact me for access
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?
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
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 committed Also get the latest example as I've updated it.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?
BTW I've got an impression that some people might be checking-out the entire project everytime I make a revision. For those people (if there are any) all that's required is to type "svn update" from within the same folder whenever you feel like doing it and you'll be in sync with the repository I'll write it up on the first page.
Hi
Grat work thunar, you are a great addition to the team
Possibly aside/
Don't know whether this is appropriate, [I think there's a GTK connection] but for widget builders/graphics projects, see nip2/VIPS
http://www.vips.ecs.soton.ac.uk/support ... dese3.html
http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS
Come across while researching VPT6
http://hcgilje.wordpress.com/
....if anyone knows how to get it to run under linux...?
thanks
Aitch
Grat work thunar, you are a great addition to the team
Possibly aside/
Don't know whether this is appropriate, [I think there's a GTK connection] but for widget builders/graphics projects, see nip2/VIPS
http://www.vips.ecs.soton.ac.uk/support ... dese3.html
http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS
Come across while researching VPT6
http://hcgilje.wordpress.com/
....if anyone knows how to get it to run under linux...?
thanks
Aitch
I know nothing about this, but I seem to have compiled them or at least packaged them. I dont remember anymore why I made the package, lol.
The needed libs are included. Pet is 4.4 Mb. Quite big in Puppy's view.
http://www.smokey01.com/pemasu/Pets/vips-nip2-0.0.1.pet
The needed libs are included. Pet is 4.4 Mb. Quite big in Puppy's view.
http://www.smokey01.com/pemasu/Pets/vips-nip2-0.0.1.pet
Thanks pemasu
I probably wasn't clear
I was searching for an implementation of VPT 6.0 in linux [Video Projection Tool/3D mapper/ multilayer renderer thingy]
I think this may be useful
http://forum.openframeworks.cc/index.php?&topic=5133.0
http://www.hv-a.com/lpmt/
Aitch
I probably wasn't clear
I was searching for an implementation of VPT 6.0 in linux [Video Projection Tool/3D mapper/ multilayer renderer thingy]
I'm interested in Artistic projection displays, possibly dynamicExploring how audiovisual technology can be used to transform, create, expand, amplify and interpret physical spaces.
I think this may be useful
http://forum.openframeworks.cc/index.php?&topic=5133.0
http://www.hv-a.com/lpmt/
Aitch
According to the Gtk specs, the button widget has an "image-position" property which defines the position of the image relative to the text inside the button. The default is left and works, but as zigbert has mentioned, in gtkdialog it does not work for any other position unless it's a gtk-stock image.
This means you can't really put a caption above or below a button image where multiple button images are used in rows.
I was wondering if this is just a gtkdialog problem or if Gtk designed it only to be used with gtk-stock images.
Cheers,
s
This means you can't really put a caption above or below a button image where multiple button images are used in rows.
I was wondering if this is just a gtkdialog problem or if Gtk designed it only to be used with gtk-stock images.
Cheers,
s
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
That's good newsseaside wrote:Thank you - I downloaded and compiled in pup431 and all is well.
This is how gtkdialog constructs a button: A GtkButton containing either a GtkLabel, a GtkImage or both packed inside a GtkHBox.seaside wrote:According to the Gtk specs, the button widget has an "image-position" property which defines the position of the image relative to the text inside the button. The default is left and works, but as zigbert has mentioned, in gtkdialog it does not work for any other position unless it's a gtk-stock image.
This means you can't really put a caption above or below a button image where multiple button images are used in rows.
I was wondering if this is just a gtkdialog problem or if Gtk designed it only to be used with gtk-stock images.
Cheers,
s
The key point here is that if it's a stock image it's managed by GTK, but an image file with a label goes into an hbox; that's the way the original author designed it. Anything that gets hardcoded can be made a choice via a tag attribute. I agree that it would be nice to have images from files placed atop labels so I'll add a feature request for it.
Regards,
Thunor
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I'm creating some feature requests for a few things people have been asking about.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
I'm wondering why you would want to pipe images into gtkdialog when you can load them as files. Is it just so that you can get gtkdialog to run a command to extract the thumbnail instead of writing it into the XML with shell script? When you refresh the pixmap widget you'll need to do it on a signal likely connected to a button, and you can have two actions, the first extracting the thumbnail and the second refreshing the pixmap widget.
There already exists a directive for inputting data from a shell command - <input></intput> - so that could be used, but I still don't see what benefit it would be to implement it. Maybe I'm missing something
pic data in hex
Dear thunor,
If hex data could be accomodated in the source, there could be a self-contained app. For time-critical applications - e.g. games - the pix data would be in the script, obviating a need for multiple disk reads. Just an idea.
With kind regards,
vovchik
If hex data could be accomodated in the source, there could be a self-contained app. For time-critical applications - e.g. games - the pix data would be in the script, obviating a need for multiple disk reads. Just an idea.
With kind regards,
vovchik