Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 27 Nov 2014, 21:29
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 34 of 64 [956 Posts]   Goto page: Previous 1, 2, 3, ..., 32, 33, 34, 35, 36, ..., 62, 63, 64 Next
Author Message
01micko


Joined: 11 Oct 2008
Posts: 7841
Location: qld

PostPosted: Sun 12 Jun 2011, 21:04    Post subject:  

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
sws-0.4exp.pet
Description 
pet

 Download 
Filename  sws-0.4exp.pet 
Filesize  1.96 KB 
Downloaded  193 Time(s) 

_________________
Woof Mailing List | keep the faith Cool |

Last edited by 01micko on Thu 23 Jun 2011, 16:49; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5789
Location: Valåmoen, Norway

PostPosted: Mon 13 Jun 2011, 02:53    Post subject:  

Mick
I am running your gtkdialog now, and everything seems to run fine. I hope I can check out thunors patch today Very Happy


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5789
Location: Valåmoen, Norway

PostPosted: Mon 13 Jun 2011, 04:59    Post subject:  

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:
<pixmap>
  <variable>ARTWORK</variable>
  <input file>$HOME/.pmusic/nowplaying_albumart.jpg</input>
  <width>100</width>
</pixmap>


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

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Mon 13 Jun 2011, 09:37    Post subject:  

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.

Last edited by thunor on Sat 18 Jun 2011, 17:00; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Mon 13 Jun 2011, 09:51    Post subject:  

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.
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Mon 13 Jun 2011, 10:22    Post subject:  

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

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 Very Happy

[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] Wink
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Mon 13 Jun 2011, 15:36    Post subject: gtkdialog patches  

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
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Mon 13 Jun 2011, 17:41    Post subject: Re: gtkdialog patches  

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 Smile Something to do later I think.

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

Thanks for your encouragement,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Mon 13 Jun 2011, 17:56    Post subject: gtkdialog  

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
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Tue 14 Jun 2011, 09:59    Post subject:  

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

Last edited by thunor on Sat 18 Jun 2011, 17:02; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5789
Location: Valåmoen, Norway

PostPosted: Tue 14 Jun 2011, 10:34    Post subject:  

Quote:
So zigbert, this will work

Very Happy Very Happy Very Happy


Thank you !!!
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Tue 14 Jun 2011, 10:47    Post subject:  

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 Smile

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4380

PostPosted: Tue 14 Jun 2011, 12:27    Post subject:  

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)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Tue 14 Jun 2011, 14:29    Post subject:  

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 Smile

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
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7841
Location: qld

PostPosted: Wed 15 Jun 2011, 07:15    Post subject:  

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:
#!/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.
gtkdialog_moose_thunor_pixmap3.patch.gz
Description  apply with "patch -p0 < gtkdialog_moose_thunor_pixmap3.patch "
in the dir where you expanded the source.
gz

 Download 
Filename  gtkdialog_moose_thunor_pixmap3.patch.gz 
Filesize  3.1 KB 
Downloaded  197 Time(s) 

_________________
Woof Mailing List | keep the faith Cool |

Last edited by 01micko on Thu 23 Jun 2011, 16:52; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 34 of 64 [956 Posts]   Goto page: Previous 1, 2, 3, ..., 32, 33, 34, 35, 36, ..., 62, 63, 64 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1141s ][ Queries: 12 (0.0135s) ][ GZIP on ]