[Tkinter-discuss] Differences on Mac and Windows

Bhaskar Chaudhary bha100710 at gmail.com
Fri Feb 14 15:20:13 CET 2014


Hello

Thanks Michael for the suggestions.

I tried inserting root.tk.call('tk', 'scaling', '-displayof', '.',
root.winfo_fpixels('1i') / 72.0) before adding any children to the
root.

I also tried using negative size value ("Times -8 bold") as suggested.

Neither of the two made any difference on a Mac. It still looks the
way as shown in attachment.

Any more suggestions on how to correct this issue will be really appreciated.

regards
Bhaskar Chaudhary

On 2/11/14, Michael Lange <klappnase at web.de> wrote:
> Hi,
>
> On Tue, 11 Feb 2014 14:49:31 +0530
> Bhaskar Chaudhary <bha100710 at gmail.com> wrote:
>
>> Hi
>>
>> The following piece of code displays correctly on Windows PC but it
>> displays all messed up in OS X (10.9.1 and others) as shown in
>> attachment below.
> (...)
>>
>> Any reasons why it shows the way it does on Mac.
>> Thanks.
>>
>
> I think "all messed up" is a little harsh for the mac screenshot ;)
> Just a guess: the difference in the appearance of the border and the
> font might be caused by a different dpi value in use by your windows and
> OSX systems. You can check the respective values by adding the line
>
> print 'DPI value: %f' % root.winfo_fpixels('1i')
>
> to your example.
> You can even force your application to use a custom dpi value, if you do
>
> root.tk.call('tk', 'scaling', '-displayof', '.', dpi_value / 72.0)
>
> _before_ creating any of root's child widgets.
>
> As far as the font size is concerned, you can use pixel sized fonts to
> minimize the risk of your font appearance getting spoiled by dpi
> settings; to do so simply use a negative size value, as in
> "Times -8 bold".
>
> Regards
>
> Michael
>
>
> .-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.
>
> Our way is peace.
> 		-- Septimus, the Son Worshiper, "Bread and Circuses",
> 		   stardate 4040.7.
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 8365 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20140214/02359e3a/attachment.png>


More information about the Tkinter-discuss mailing list