The time now is Wed 19 Jun 2013, 07:10
All times are UTC - 4 |
| Author |
Message |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: Thu 01 Mar 2007, 00:26 Post_subject:
pConvert a Measurements Units converted (Mar 3, 2007) Sub_title: 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
 |
| Description |
This is the GTK version. Install this package if you have Puppy 2.14 or newer
|

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

Download |
| Filename |
tkConvert-2.15-1.pup |
| Filesize |
23.12 KB |
| Downloaded |
339 Time(s) |
_________________ http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Edited_times_total
|
|
Back to top
|
|
 |
WhoDo

Joined: 11 Jul 2006 Posts: 4441 Location: Lake Macquarie NSW Australia
|
Posted: 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
|
|
 |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: 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
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 6874 Location: Perth, Western Australia
|
Posted: 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
|
|
 |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: 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
|
|
 |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: 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
|
|
 |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: 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
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6199 Location: Auckland, New Zealand
|
Posted: 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
|
|
 |
|
|
|
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|