Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#31 Post by thunor »

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.
You're welcome. Storing binary files in shell variables is noted.
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?
Yep, implemented and committed :) Also get the latest example as I've updated it.

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.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#32 Post by seaside »

thunar,

Fantastic! :) :)

Thank you - I downloaded and compiled in pup431 and all is well.

Regards,
s

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#33 Post by Aitch »

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 :)

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#34 Post by pemasu »

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

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#35 Post by Aitch »

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]
Exploring how audiovisual technology can be used to transform, create, expand, amplify and interpret physical spaces.
I'm interested in Artistic projection displays, possibly dynamic


I think this may be useful

http://forum.openframeworks.cc/index.php?&topic=5133.0

http://www.hv-a.com/lpmt/

Aitch :)

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#36 Post by seaside »

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

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#37 Post by thunor »

seaside wrote:Thank you - I downloaded and compiled in pup431 and all is well.
That's good news :)
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
This is how gtkdialog constructs a button: A GtkButton containing either a GtkLabel, a GtkImage or both packed inside a GtkHBox.

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

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#38 Post by seaside »

thunor,

Thanks for taking the time to explain why this doesn't work. Many of us know what doesn't work, but really don't know why, and have no avenue to actually find out - except, of course, by having a resident expert :)

Thank you again for all your exceptional work.

Regards,
s

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#39 Post by thunor »

seaside wrote:
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?:

Code: Select all

    <pixmap>
      <input command>jhead -st - /24543.jpg</input>
    </pixmap>
Don't worry, I'm not thinking of writing a gtkdialog gui for all the command line image editors... although that would be interesting ;)
disciple,

I think this could work. I don't have jhead, so can't check.

Code: Select all

 
<pixmap>
  <input file>$(jhead -st - /24543.jpg)</input>
</pixmap>
Cheers,
s
I'm creating some feature requests for a few things people have been asking about.

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 :)

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

pic data in hex

#40 Post by vovchik »

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

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#41 Post by disciple »

thunor wrote:I'm wondering why you would want to pipe images into gtkdialog when you can load them as files.
I would rather not create the files, that's all.
Is it just so that you can get gtkdialog to run a command to extract the thumbnail
Yes.
instead of writing it into the XML with shell script?
I'm not certain what you mean here - how can I write the thumbnail into the XML?
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.
I'm not so much interested in refreshing the widget. An example of what I would like to do could be modifying pmetatagger so that when it reads the tag of a jpeg or an mp3 it displays the exif thumbnail or the embedded album art, without saving it as a temporary file. Similarly, Pmusic could display embedded album art.

But there would be some seriously cool uses for it in combination with refreshing a widget - e.g. a gtkdialog photo browser could be written, which would display the embedded thumbnails for all the images in a directory, in a scrollable hbox (or vbox), and clicking on a thumbnail would display the full size image above (or to the right of) the hbox (or vbox). This would not be the best way to implement a photo browser, but it would be cool ;)
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 :)
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#42 Post by technosaurus »

It took me a bit to figure out how to use gtkbuilder, but I was able to tweak one of the vala/gtkbuilder examples to behave similar to glade+gtkdialog (after compiling to c)

It would display the GUI fine but I couldn't get the actions to run scripts functions like gtkdialog ... what code does that part? ... maybe we could use it to remove the optional (and deprecated) glade dependencies.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#43 Post by thunor »

Added button widget image positioning capability

The widget reference is available here.

Now all buttons with images can use the "image-position" tag attribute :) Use values of "0/1/2/3". Note that this is an existing GTK property that already worked with stock buttons but I have extended it to work with Gtkdialog's image buttons. If you use it in the custom sense then you can also pass "left/right/top/bottom".

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 funcbtnType0Create() {
	echo '<button image-position="'$1'" use-stock="true" label="gtk-'$2'">
			<action>""</action>
		</button>'
}

function funcbtnType1Create() {
	echo '<button image-position="'$1'">
			<label>'$1'</label>
			<input file stock="gtk-'$2'"></input>
			<action>""</action>
		</button>'
}

function funcbtnType2Create() {
	echo '<button image-position="'$1'">
			<label>'$1'</label>
			<variable>btn'$2$1'</variable>
			<input file>image.svg</input>
			<action>echo Refreshing btn'$2$1'</action>
			<action>refresh:btn'$2$1'</action>
		</button>'
}

function funcbtnType3Create() {
	echo '<button image-position="'$1'">
			<label>'$1'</label>
			<variable>btn'$2$1'</variable>
			<input file>image.svg</input>
			<width>64</width>
			<action>echo Refreshing btn'$2$1'</action>
			<action>refresh:btn'$2$1'</action>
		</button>'
}

function funcimgCreate() {
	echo '<svg  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
			<rect x="0" y="0" height="32" width="32" fill="#000000"/>
			<rect x="2" y="2" height="28" width="28" fill="#ffffff"/>
			<rect x="16" y="16" height="12" width="12" fill="#d0d0d0"/>
			<rect x="4" y="16" height="12" width="12" fill="#a0a0a0"/>
			<rect x="4" y="4" height="12" width="12" fill="#707070"/>
			<rect x="16" y="4" height="12" width="12" fill="#404040"/>
			<rect x="18" y="18" height="4" width="4" fill="#ffffff"/>
			<rect x="22" y="18" height="4" width="4" fill="#a0a0a0"/>
			<rect x="22" y="22" height="4" width="4" fill="#707070"/>
			<rect x="18" y="22" height="4" width="4" fill="#404040"/>
		</svg>' > image.svg
}; export -f funcimgCreate

if [ ! -f image.svg ]; then funcimgCreate; fi

export MAIN_DIALOG='
<window title="btnImagePosition" width-request="500" resizable="false">
	<vbox>
		<frame Stock images (and labels) using GTK properties>
			<hbox homogeneous="true">
				'"$(funcbtnType0Create 0 about)"'
				'"$(funcbtnType0Create 1 add)"'
				'"$(funcbtnType0Create 2 apply)"'
				'"$(funcbtnType0Create 3 bold)"'
			</hbox>
		</frame>
		<frame Stock images using Gtkdialog directives>
			<hbox homogeneous="true">
				'"$(funcbtnType1Create Left about)"'
				'"$(funcbtnType1Create Right add)"'
				'"$(funcbtnType1Create Top apply)"'
				'"$(funcbtnType1Create Bottom bold)"'
			</hbox>
		</frame>
		<frame Images from files using Gtkdialog directives>
			<hbox homogeneous="true">
				'"$(funcbtnType2Create Left Woden)"'
				'"$(funcbtnType2Create Right Woden)"'
				'"$(funcbtnType2Create Top Woden)"'
				'"$(funcbtnType2Create Bottom Woden)"'
			</hbox>
		</frame>
		<frame Scaled images from files using Gtkdialog directives>
			<hbox homogeneous="true">
				'"$(funcbtnType3Create Left Frige)"'
				'"$(funcbtnType3Create Right Frige)"'
				'"$(funcbtnType3Create Top Frige)"'
				'"$(funcbtnType3Create Bottom Frige)"'
			</hbox>
		</frame>
		<hbox homogeneous="true">
			<button>
				<label>Remove/Create Image</label>
				<variable>btnimgControl</variable>
				<input file>image.svg</input>
				<width>16</width>
				<action>if [ ! -f image.svg ]; then funcimgCreate; else rm image.svg; fi</action>
				<action>refresh:btnimgControl</action>
			</button>
			<button ok></button>
		</hbox>
	</vbox>
	<action signal="hide">exit:Exit</action> 
</window>
'

$GTKDIALOG --center --program=MAIN_DIALOG
Regards,
Thunor
Last edited by thunor on Fri 12 Aug 2011, 13:55, edited 1 time in total.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#44 Post by thunor »

Aitch: Thanks for the encouragement :)

disciple: Yeah, I see the point about creating many thumbnails without the many temporary files to go with them :) BTW the Gtkdialog Application Index is a really great resource but I'm linking to it from the Gtkdialog project page and I have to login to view it. Is that right?
technosaurus wrote:It took me a bit to figure out how to use gtkbuilder, but I was able to tweak one of the vala/gtkbuilder examples to behave similar to glade+gtkdialog (after compiling to c)

It would display the GUI fine but I couldn't get the actions to run scripts functions like gtkdialog ... what code does that part? ... maybe we could use it to remove the optional (and deprecated) glade dependencies.
glade_support.c is the interface between Glade and Gtkdialog. I had to update it to support the new comboboxtext widget, so it's something that has to be maintained even if there're only one or two application developers using it. Maybe we should specifically state that Glade support is deprecated.
Last edited by thunor on Tue 05 Jul 2011, 21:30, edited 2 times in total.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#45 Post by seaside »

thunor,

I updated (carefully using svn update :) ) and compiled your latest in pup431. I can happily report that you've scored another very nice new capability.

The example is great and it looks like gtkdialog and you were made for each other. 8)

Regards,
s

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#46 Post by disciple »

thunor wrote:BTW the Gtkdialog Application Index is a really great resource but I'm linking to it from the Gtkdialog project page and I have to login to view it. Is that right?
No, it shouldn't be like that. It looks like that whole section of the forum is invisible if you are not logged in - someone must have set it up wrong.
Thanks, I'll PM Flash to see if it can be fixed.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#47 Post by disciple »

thunor wrote:glade_support.c is the interface between Glade and Gtkdialog. I had to update it to support the new comboboxtext widget, so it's something that has to be maintained even if there're only one or two application developers using it. Maybe we should specifically state that Glade support is deprecated.
Is there actually anybody developing with it?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#48 Post by thunor »

disciple wrote:Is there actually anybody developing with it?
Partview is using it.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#49 Post by 01micko »

I'm pretty sure forum member neurino is actively using glade with gtkdialog.

Also rox uses glade, so deprecated it may be but actively used.
Puppy Linux Blog - contact me for access

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#50 Post by technosaurus »

thunor wrote:
disciple wrote:Is there actually anybody developing with it?
Partview is using it.
I have a version of partview that doesn't ... I even use bash to dynamically generate images; however, this did remind me of a feature that AFAIK has been missing ... the sliders[/quote]
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply