Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Tcl::Tk exit ( Tcl::pTk )

by kcott (Archbishop)
on May 28, 2017 at 07:32 UTC ( [id://1191408]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^4: Tcl::Tk exit ( Tcl::pTk )
by Sandy (Curate) on May 29, 2017 at 02:07 UTC
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1191408]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found