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 Wed 23 Apr 2014, 20:01
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
pConvert a Measurements Units converted (Mar 3, 2007)
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 01 Mar 2007, 00:26    Post subject:  pConvert a Measurements Units converted (Mar 3, 2007)
Subject description: This is a full rewrite of tkConvert
 

I had some time to spare and decided to tackle cleaning up a couple of tcl/tk applicaitions included in Puppy that had a rather old look.

I've completelly rewriten the tkConvert utility to make it fully GTK compatible.

This utility lets you convert from almost any measurement unit to another. It includes around 1,000 conversions.

In the process I managed to reduce 2159 lines of code while adding functionality!!,
(Barry, that's 103K. I'm making good in my promisse to give back the space taken by gnocl) I could still reduce around 400 lines of code and in the process add about another 1,000 available conversions and provide an even cleaner interface and make the code even more readable. But for now I think this is good enough.

Here is the GTK version with an Aqua theme (Click to see full size)

Here is the cleaned up tk version (Click the thumbnail to see the full size image)


Dependencies
The GTK version requires Gnocl. If you have a version of Puppy prior to 2.14 you'll need to get it from here:
http://www.murga-linux.com/puppy/viewtopic.php?t=15639
pConvert-2.15-1.pet
Description  This is the GTK version. Install this package if you have Puppy 2.14 or newer
pet

 Download 
Filename  pConvert-2.15-1.pet 
Filesize  11.95 KB 
Downloaded  391 Time(s) 
tkConvert-2.15-1.pup
Description  This is the Tk version Install this package if you don't want to install gnocl
pup

 Download 
Filename  tkConvert-2.15-1.pup 
Filesize  23.12 KB 
Downloaded  357 Time(s) 

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to

Last edited by rarsa on Sat 03 Mar 2007, 15:35; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website 
WhoDo


Joined: 11 Jul 2006
Posts: 4441
Location: Lake Macquarie NSW Australia

PostPosted: Thu 01 Mar 2007, 01:04    Post subject: Re: TkConvert with a cleaned up UI  

rarsa wrote:
I refrained from converting them to gnocl until it is included in the LiveCD so they still have the tk look, just a little bit cleaner.

Just so you know, rarsa, I have added gnocl to both Alpha's of Puppy 2.15CE.

Cheers
Back to top
View user's profile Send private message 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 01 Mar 2007, 10:37    Post subject: Re: TkConvert with a cleaned up UI  

rarsa wrote:
I refrained from converting them to gnocl until it is included in the LiveCD so they still have the tk look, just a little bit cleaner.
Clarification: I should have said: "I refrained from converting them directly to gnocl...

I wanted to release something that could be used and included right now. I will for sure convert them to GTK, wether it is gnocl or GINS.

I still cannot comment on GINS because I hadn't had time to play with it.

I've said before for a project like this I believe that ONE standard that is good enough is better than 10 different toolkits that are respectivelly "the best"

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Thu 01 Mar 2007, 21:45    Post subject:  

Rarsa,
how much work is involved in converting a Tcl/Tk app from Tk to Gnocl? What about some of the bigger guys, like Ical?
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 02 Mar 2007, 01:22    Post subject:  

BarryK wrote:
how much work is involved in converting a Tcl/Tk app from Tk to Gnocl? What about some of the bigger guys, like Ical?
The couple I've done haven't been difficult at all, it is very straight forward.

The only problem may be when trying to implement Tk functionality that it is not available in gnocl. Tk is a huge toolkit. Gnocl follows the 80/20 rule providing the 20% Tk functionality that is used 80% of the time. There is a workaround for special functionality though. You can embed a Tk window in a Gnocl window.
Code:
wm state . withdrawn    ; # hide tk main window
set socket [gnocl::socket]
toplevel .embededTk -use [format "0x%x" [$socket getID]]
set trayWindow [gnocl::window -child $socket]


Another example is the remotedesktop client. It took In total effort hours maybe 4 hours for the remotedesktop client, and that was while learning Gnocl.

Gnocl syntax is more economical than Tk syntax so that helps.

Translating the tkConvert may take me 1/2 hour for the straight conversion. I want to cleanup the code though and that's where the extra time goes.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 02 Mar 2007, 15:45    Post subject:  

BarryK wrote:
What about some of the bigger guys, like Ical?
Well, Ical is a compiled application so it would require a full language translation, not only a UI translation.

Do you have any applications in mind for translation. I have my own priority list but it is quite arbitrary.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sat 03 Mar 2007, 15:33    Post subject:  

pConvert uploaded!

http://www.murga-linux.com/puppy/viewtopic.php?p=100866#100866

I've completelly rewriten the tkConvert utility to make it fully GTK compatible. I used Gnocl.

In the process I managed to reduce 2159 lines of code while adding functionality !!,

Barry, that's 103K. I'm making good in my promisse to give back the space taken by gnocl.

I could still reduce around 400 lines of code and in the process add about another 1,000 available conversions and provide an even cleaner interface and make the code even more readable. But for now I think this is good enough and going the extra mile would take me at least 8 hours.

Actually the real code is just 230 Lines of code (including spaces)

1000 lines that correspond to the conversions table. Here is where getting creative a lot of redundancy could be cut.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6378
Location: Auckland, New Zealand

PostPosted: Tue 26 Jun 2007, 06:26    Post subject:  

If anybody else ever feels like rewriting it for whatever reason, they may want to think about whether the interface can be improved. Check out the freeware windows convert program at http://joshmadison.com/software/convert/ (there is a screenshot). Personally I find the interface much more efficient.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
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.0682s ][ Queries: 13 (0.0095s) ][ GZIP on ]