Page 25 of 76

Posted: Mon 13 Jun 2011, 01:04
by 01micko
Thanks again thunor

Well it's working well for me. This time I have compiled a gtkdialog executable with all patches and made a new patch with the new functionality to scale images and including the return ""; line in src/stringman.c. I have also adjusted the SWS to ditch the scale2pics dependency. Result is a 2K wallpaper setter! (and it's much faster without the loop to scale all the wallpapers, potentially very slow if you have many wallpapers in your collection). I have tested some (but far from all) legacy gtkdialog3 apps and they all still work so far.

So test the exec if you dare. It's gzipped so you will have to gunzip it and make it executable. This time I named it 'gtkdialog3' to be compatible with all current gtkdialog 3 progs. Backup the older gtkdialog3 and place the new gtkdialog3 exec in /usr/sbin of course at your own risk. SWS is attached too, just as a demo. Note I had to set the width of the vbox container so the gui wouldn't keep switching size due to different aspect ratios of the images in my backgrounds directory. I set the height of the pixmap only.

Have fun!

EDIT: removed attachments, get gtkdialog from svn
see my post down page for patch at the time

Posted: Mon 13 Jun 2011, 06:53
by zigbert
Mick
I am running your gtkdialog now, and everything seems to run fine. I hope I can check out thunors patch today :D


Sigmund

Posted: Mon 13 Jun 2011, 08:59
by zigbert
Works very well. I like the scaling.....
Could this technique be used for buttons as well? If so, we can make an image clickable (ie. to show the full sized image).

Scaling works perfectly

Code: Select all

<pixmap>
  <variable>ARTWORK</variable>
  <input file>$HOME/.pmusic/nowplaying_albumart.jpg</input>
  <width>100</width>
</pixmap>
Image gets cropped

Code: Select all

<button relief="2" width-request="100">
  <variable>ARTWORK</variable>
  <input file>$HOME/.pmusic/nowplaying_albumart.jpg</input>
</button>

Posted: Mon 13 Jun 2011, 13:37
by thunor
Additionally, in src/stringman.c replace function find_pixmap with this:

[EDIT] 20110618-22:01 Gtkdialog is now in a repository (see this post).

So, now if an image file doesn't physically exist then you will see gtk's stock broken image icon instead of blankness.

find_pixmap is still being used but as can be seen above, I've disabled all of the original developer's personal code that is of little use to anyone else.

Posted: Mon 13 Jun 2011, 13:51
by 8-bit
thunor,

Would it be possible for you to compress the full source directory in a tar.gz file and attach it here?
Also, if you compiled using patches maybe include them?

Also, does your current version include the patches by Moose on The Loose?

My copy of source appears to include your latest patch as well as the others.
That is to say, I did the return""; change and even got it in the same place as you have shown.
So other than the comments, all matches.

Posted: Mon 13 Jun 2011, 14:22
by thunor
01micko wrote:Note I had to set the width of the vbox container so the gui wouldn't keep switching size due to different aspect ratios of the images in my backgrounds directory. I set the height of the pixmap only.
Hi 01micko

I've been using <pixmap height-request="300" width-request="300"> which does the same thing but more specific to the pixmap.
zigbert wrote:Could this technique be used for buttons as well? If so, we can make an image clickable (ie. to show the full sized image).
Hi zigbert

Yes, it would be possible to enable button images to be scalable as long as <width> and <height> aren't already being used by the button, and it doesn't look as though they are. It would be useful for example generating buttons that include application icons which may be of various sizes and scaling would make them all uniform.

I was thinking last night that actions on pixmaps would be useful (you could make board games :) ) and I haven't yet found a pixmap action that works.
8-bit wrote:Would it be possible for you to compress the full source directory in a tar.gz file and attach it here?
Also, if you compiled using patches maybe include them?

Also, does your current version include the patches by Moose on The Loose?

My copy of source appears to include your latest patch as well as the others.
That is to say, I did the return""; change and even got it in the same place as you have shown.
So other than the comments, all matches.
Hi 8-bit

You might want to look at the post above you :)

I'm not the Puppy Linux gtkdialog3 source code maintainer (BarryK is I think) so I'm just merrily hacking away at gtkdialog-0.7.20 on my computer and uploading new needed code/functions which I guess BarryK is going to add to the gtkdialog3 source code to make a new version at some point in the near future. Therefore there's nothing else for me to upload.

I still am interested in creating a new gtkdialog project page though so that all *nix distributions use the same version -- posting code on a forum instead of using a repository and version control software is only going to be practical for relatively straight-forward updates and possibly it's getting a bit unmanageable already :D

[EDIT] I think what I'll do now is attempt the button image scaling. I don't recommend generating and posting patches of what I've done so far because I'm about to change widget_button_refresh [again] ;)

gtkdialog patches

Posted: Mon 13 Jun 2011, 19:36
by vovchik
Dear thunor,

What you are doing is great. Keep it up. I would like to see a fewr widgets added, including a slider. Any chance?

With thanks in advance and kind regards,
vovchik

Re: gtkdialog patches

Posted: Mon 13 Jun 2011, 21:41
by thunor
vovchik wrote:Dear thunor,

What you are doing is great. Keep it up. I would like to see a fewr widgets added, including a slider. Any chance?

With thanks in advance and kind regards,
vovchik
Hi vovchik

I have investigated adding new widgets already as I personally could make use of a horizontal seperator (GtkSeparator) but it will require editing a lot of files that I'm not particularly familiar with yet :) Something to do later I think.

http://developer.gnome.org/gtk/2.24/GtkScale.html

Thanks for your encouragement,
Thunor

gtkdialog

Posted: Mon 13 Jun 2011, 21:56
by vovchik
Dear thunor,

I managed to create a slider in BaCon, using gtk calls to a few libs and after studying gtk/gdk samples in C. I think creating the horizontal separator is not too hard:

gtk_hseparator_new from libgtk-x11-2.0.so as type long

Good luck. I look forward to every patch...

With kind regards,
vovchik

Posted: Tue 14 Jun 2011, 13:59
by thunor
New code: adds button image scaling functionality:

[EDIT] 20110618-22:01 Gtkdialog is now in a repository (see this post).

So zigbert, this will work (you need to leave 100-90=10 pixels for the button otherwise the scaled image will get cropped):

Code: Select all

<button relief="2" width-request="100" height-request="100">
  <variable>ARTWORK</variable>
  <width>90</width><height>90</height>
  <input file>$HOME/.pmusic/nowplaying_albumart.jpg</input>
  <action>echo Do something here</action>
</button>

Posted: Tue 14 Jun 2011, 14:34
by zigbert
So zigbert, this will work
:D :D :D


Thank you !!!
Sigmund

Posted: Tue 14 Jun 2011, 14:47
by thunor
Unless there's anything else that's relatively easy enough to implement, I think I might leave it there for the moment. I expect that BarryK would like to make a new gtkdialog3 pet release.

Amazingly the sun is out (crappest Summer for years) so I'm going to escape to the countryside on my mountain bike :)

Regards,
Thunor

Posted: Tue 14 Jun 2011, 16:27
by technosaurus
Not sure how scattered the glade support is, but it would be nice to port it to gtkbuilder. Not many devs use the glade functions, but they are part of the examples, (there was discussion to just compile it without glade support, since it is optional, but gtkbuilder wouldn't add any dependencies)

Posted: Tue 14 Jun 2011, 18:29
by seaside
thunor wrote:Unless there's anything else that's relatively easy enough to implement, I think I might leave it there for the moment. I expect that BarryK would like to make a new gtkdialog3 pet release.

Amazingly the sun is out (crappest Summer for years) so I'm going to escape to the countryside on my mountain bike :)

Regards,
Thunor
Thunor,

Many thanks for your work on reenergizing Gtkdialog.

There is one item missing from Gtkdialog - the ability to do multiple selection of items.

I was thinking that perhaps Yad (follow-on to Zenity) would provide a better general purpose utility because it has multiple selection ability and is being very actively developed, but it just isn't up to Gtkdialog in it's scope.

Gtkdialog is much more powerful and just needs a few edges polished like the nice work you did for pixmaps.

Thanks again for your interest and work.

Cheers,
s

Posted: Wed 15 Jun 2011, 11:15
by 01micko
How do we set up a sourceforge or google account for this? It's getting a bit hard to keep up! I compiled thunor's patches in and thought everything was rosy until I realised I forgot the Moose patch!

Well it's included in the following attachments.. and here's a demo script too.

Code: Select all

#!/bin/sh
ln -s /usr/share/backgrounds/don.jpg /tmp/pic.jpg
funcswitch(){
	if [ "`readlink /tmp/pic.jpg`" = "/usr/share/backgrounds/don.jpg" ];then rm /tmp/pic.jpg && ln -s /usr/share/backgrounds/default.jpg /tmp/pic.jpg
	 else rm /tmp/pic.jpg && ln -s /usr/share/backgrounds/don.jpg /tmp/pic.jpg
	fi
}
export -f funcswitch
export GUI='<vbox>
<button relief="2" width-request="200" height-request="100">
  <variable>ARTWORK</variable>
  <width>190</width><height>90</height>
  <input file>/tmp/pic.jpg</input>
  <action>funcswitch</action>
  <action type="refresh">ARTWORK</action>
</button>
</vbox>'
gtkdialog3 -p GUI
unset GUI
Just copy one of your wallpapers as "don.jpg" or change "don.jpg" in the script.

Have fun!

EDIT: gtkdialog attacment removed, get it from svn
The patch attached is out dated, however it was relevant at time of posting.

Posted: Wed 15 Jun 2011, 14:47
by thunor
seaside wrote:There is one item missing from Gtkdialog - the ability to do multiple selection of items.
[EDIT] Updated 20110621-18:38

Hi seaside

Implemented in SVN r12 :)

See this post for syntax and example code.

Regards,
Thunor

no more gif animation

Posted: Wed 15 Jun 2011, 17:56
by vovchik
Dear thunor,

I just noticed that the latest patches prevent gtkdialog from showing animated gifs :(. Standard issue does, and I use it to show animations as follows:


Code: Select all

#! /bin/bash

# -----------------
# Functions
# -----------------

# --------------
# get pic info
# --------------
init_vars()
{
mypicsize=`stat --format=%s "$mypic"`
mypicinfo=`nconvert -info -quiet "$mypic"`
mypicinfo=`echo "$mypicinfo" | grep -v Success`
mypicbase=`basename $mypic`
mypicinfo="    Image           : ""$mypicbase""$mypicinfo""
    Size            : $mypicsize"" bytes"
}


# --------------
# make pic gui
# --------------
make_pic_gui()
{

export show_pic='
<window title="PShowPic: '$mypicbase'" icon-name="gtk-refresh">
	<vbox>
		<frame>
			<pixmap>
				<input file>'$mypic'</input>
			</pixmap>
		</frame>
		<hbox>
			<button help>
				<action>launch:show_pic_help</action>
			</button>
		</hbox>
	</vbox>
</window>
'
}

# --------------
# make help gui
# --------------

make_help_gui()
{
export show_pic_help='
<window title="PShowPic Info" icon-name="gtk-about">
	<vbox>
		<frame>
			<text use-markup="true">
				<label>"<tt><b>'$mypicinfo'</b></tt>"</label>
			</text>
		</frame>
		<hbox>
			<button cancel>
				<action>closewindow:show_pic_help</action>
			</button>
		</hbox>
	</vbox>
</window>
'
}

# --------------
# display gui
# --------------

display_gui()
{
	gtkdialog3 --program=show_pic --center 
}

# -----------------
# End Functions
# -----------------

# -----------------
# Main
# -----------------

mypic="$1"
init_vars
make_pic_gui
make_help_gui
display_gui

# -----------------
# End Main
# -----------------
Can anything be done to preserve this ability and still enable scaling? Could be a "trade-off" or a regression error.

With kind regards,
vovchik

Re: no more gif animation

Posted: Thu 16 Jun 2011, 12:21
by thunor
vovchik wrote:I just noticed that the latest patches prevent gtkdialog from showing animated gifs...
[EDIT] I have modified the code. Therefore [currently] animated gifs will scale but they'll stop animating. Viewnior manages to scale them so I just need to look into it.
01micko wrote:How do we set up a sourceforge or google account for this? It's getting a bit hard to keep up! I compiled thunor's patches in and thought everything was rosy until I realised I forgot the Moose patch!
[EDIT] I have created a project page for gtkdialog and am in the process of setting it up.

Regards,
Thunor

Posted: Sat 18 Jun 2011, 00:13
by 01micko
Thanks for setting up the project page thunor!

IMHO it assures the continuation of development for gtkdialog. I did a checkout and the animated gifs work fine for me if left unscaled. I'm sure that will please vovchik as well.

_____

OT.. checked out a couple of your games, "pipe panic" is a fun spin on that old dos version :) . I might make a post in the games thread.

Cheers

Posted: Sat 18 Jun 2011, 05:09
by zigbert
thunor wrote:I have created a project page for gtkdialog and am in the process of setting it up.
This makes me emotional.