http://qs1969.pair.com?node_id=1191373


in reply to Re: Tcl::Tk exit ( Tcl::pTk )
in thread Tcl::Tk exit

Why I have to move from Perl/Tk

On MAC, results look crappy using Quartz.

Users of my tool are not computer savvy, and prefer a zip, unzip, ready to go tool

So, are you saying that Tcl::pTk is more similar to Perl/Tk than Tcl::Tk?

I am still assessing options

Thanks

Replies are listed 'Best First'.
Re^3: Tcl::Tk exit ( Tcl::pTk )
by kcott (Archbishop) on May 28, 2017 at 07:32 UTC

    G'day Sandy,

    "On MAC, results look crappy using Quartz."

    In general, I don't disagree with this at all.

    Having said that, if your only issue is one of look and feel, then that's what I'd target for change (rather than rewriting all of your Tk applications in a different flavour of Tk).

    Unfortunately, while I can agree with "look crappy" in general, that doesn't really provide much in the way of concrete information. Here's a couple of suggestions.

    The default fonts (Times, Helvetica and Courier) are intended to work on any platform; however, that's where it ends — there's no promise of how they'll look on any particular platform. Consider changing these to ones you prefer. I don't normally use a serif font in Tk applications; for sans-serif and monospace my personal preferences would possibly be Verdana and Menlo. Take a look Tk::Font.

    I personally find the default look and feel to be rather chunky; in particular, the 2px borders around buttons, scrollbars and other widgets. Simply changing those to 1px may make a big difference. See Tk::options for the standard options; follow links from the Tk distribution page for widget-specific options.

    You can use the option database (Tk::option) to make those changes globally, for all of your applications, as a one-off task; you don't need to go through every application and change every instance of -font, -borderwidth, and so on.

    — Ken

      Perhaps I should have been more specific. The canvas on perl/Tk does not render nicely in Perl/Tk, especially on Mac. Although the fonts don't look so great, whether in canvas or not.

      I create videos for youtube using stuff I wrote in Perl/Tk (Euclid). The fonts render in a very chunky fashion (I think the issue is that XQuartz is mimicking a resolution that is much less than the real resolution, so I end up with blocky fonts).

      I tried all possible fonts, I really did.

      In desperation, I created a library of png images by screen capturing text written in OpenOffice, in the font that I wanted. And then overrode the ->text function to replace the given text with individual pics. It worked, but let me tell you, that is quite the hack, and limited me to my predefined pics. I did this for the first 4 books. Then, to make the lines look nice, I drew a fat grey line, a slightly less fat slightly darker line, until I drew the final black line.

      Finally, I ended up trying Tcl/Tk (book 5 playlist uses Tcl/Tk), which works well enough that I can just use the regular fonts.

      Here are two pics for comparison (Tk screenshots). This is what Perl/Tk looks like without doing any of the fancy stuff I described in the previous paragraph. Exact same code.

      Notice that even the drawing of the circle in Perl/Tk is jagged, whereas Tcl/Tk is nice and smooth. The font of the labels is Arial. The regular text is also Arial.

Re^3: Tcl::Tk exit ( Tcl::pTk )
by choroba (Cardinal) on May 28, 2017 at 07:19 UTC
    > On MAC, results look crappy using Quartz.

    Maybe you need to add the XFT=1 option to Makefile.PL?

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re^3: Tcl::Tk exit ( Tcl::pTk )
by Anonymous Monk on May 28, 2017 at 00:55 UTC

    On MAC, results look crappy using Quartz.

    They should look familiarly like Tk

    Users of my tool are not computer savvy, and prefer a zip, unzip, ready to go tool

    Not sure what that has to do with your choice of "Tk" flavor, since you're going to be distributing the zip for your users, just provide everything required, as cavapackager/citrusperl/PAR can help you provie

    So, are you saying that Tcl::pTk is more similar to Perl/Tk than Tcl::Tk? I am still assessing options

    Hehehe, Tcl::pTk is a "Tk.pm" interface to "Tcl::Tk" that is you change nothing in your Tk.pm code, just add one line (maybe two), and you get "Tcl::Tk" looks