Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Tk Text -font=>segfault

by igelkott (Priest)
on Mar 27, 2008 at 22:14 UTC ( [id://676868]=note: print w/replies, xml ) Need Help??


in reply to Tk Text -font=>segfault

Works for me with and w/o the font specification (Perl 5.10, ActiveState, WinXP).

Could it be something as simple as needing to write "Courier" rather than "courier"? At least that's the way I'm used to seeing the font families written.

Update: I guess the font family names are supposed to be case-insensitive so that shouldn't be the problem. Shouldn't even get a seg fault if Courier was for some odd reason missing from your system.

Replies are listed 'Best First'.
Re^2: Tk Text -font=>segfault
by halfcountplus (Hermit) on Mar 27, 2008 at 22:31 UTC

    (nb. this is not a missing or misnamed font issue)

    Oh no! Before i convince myself this is a 5.8.8 glitch and that i should upgrade, can someone with 5.10 on linux confirm igelkott's observation?

      This may or may not help you much, as I don't have Linux. But I've tried the code provided on my Mac running both 5.8.8 and 5.10, and neither seg faults. However, neither does what's expected, either. I'm guessing that if the user types in the text fields in the tabs, the text is supposed to render as 12 point Courier, and that doesn't seem to work for me (didn't on my Windows box running strawberry perl 5.10, either).

      However, there's a workaround. Add use Tk::Font then change

      foreach (keys %pg) {$txt{$_} = $pg{$_}->Text(-font=>"courier-12")->pack()}

      to

      foreach (keys %pg) {$txt{$_} = $pg{$_}->Text()->pack(); $pg{$_}->Font(family=>'courier',point=>12)}

      and see if that gets you what you need.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found