Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: font measurement

by preahkumpii (Novice)
on Jan 30, 2012 at 15:47 UTC ( #950791=note: print w/replies, xml ) Need Help??


in reply to Re: font measurement
in thread font measurement

I appears from this code (I am no perl professional) that a window is created for the text. In my case the measuring will only be used as a means to determine the length of the string to keep, and what to remove. So, it is just an intermediate step. So if this code opens a separate window I think that would have a significant performance hit on this already slow program (not the example I gave, but the real program I am working on).

Replies are listed 'Best First'.
Re^3: font measurement
by zentara (Archbishop) on Jan 30, 2012 at 17:58 UTC
    BrowserUk gave you the preferred answer below, but if you wanted to use my Canvas method, without invoking a window, all you need to do is comment out the line #MainLoop. Then if you run it, it will not show a window.

    Either way, you are loading Tk. You can either load Tk::Text or a Tk::Canvas. Tk is relatively light and fast to load.


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950791]
help
Chatterbox?
What's the matter? Cat got your tongue?...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2016-12-10 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (165 votes). Check out past polls.