tags:

views:

921

answers:

4

I have an application that is built to work on Windows, Linux, and Solaris that uses the Perl/TK GUI. Due to constraints, we are limited to Perl/TK only. Moreover, we are limited to an old Perl/Tk version, 5.00404.

I'd like to work within these limitations to make the GUI look as nice and modern as possible.

Are there any web-resources that have TK design schemes (for buttons, frames, colors, etc) that could assist me in this endeavor?


I am also looking for modernization advices like the one that I found here:

If you're finding that your Tk apps look a little ugly on X-based systems, try adding the following lines to the top of your script:

$mw->optionAdd("*font", "-*-arial-normal-r-*-*-*-120-*-*-*-*-*-*");
$mw->optionAdd("*borderWidth", 1);
+3  A: 

You could use the Tk theme engine to give your app better looks.

dsm
Downvoted because you can't access the ttk stuff from Perl 5.004. AFAICT you need at least 5.6 to access the newer bindings (Tkx or Tcl::Tk) that allow use of the theme support in recent versions of Tk.
Michael Carman
That's not strictly true. There is a compatibility library (named "tile") that works with 8.5 (and has worked with 8.5 for a couple years now). I have no idea if that can be used with Python or how easy that would be.
Bryan Oakley
Not sure how relevant whether it can be used with Python or not is?
MkV
+2  A: 

Using optionAdd to tweak defaults through the option database is a reasonable start. A thread about this can be found at:

http://tcl.projectforum.com/tk/221

Download griffin.kit from there, use the sdx tool to unwrap it and locate griffin.tcl to get a good set of option settings.

http://wiki.tcl.tk/3411 for the sdx tool.

Hugge
Does it work with Perl/TK, or only TCL/TK ?
Igor Oks
It is written for Tcl but should be trivially translatable to Perl.
Hugge
+3  A: 

Try using images instead of button elements, then you can have whatever style you like and the fonts can be baked in. This will work for pretty much any element where the contents are not dynamic - including backgrounds on panes and such. Granted it's more work but it does solve your problem, especially if you have a competent artist in your project group.

SpliFF
this may not be the most 'elegant code' solution, but it's nicely pragmatic. one thing to look out for is resizing.
Martin DeMello
Woo hoo! My first bounty! Thank you.
SpliFF
A: 
ephemient