I get same under Tk.pm and Tcl::Tk.pm

screen name :0.0 pixel width 1024 pixel height 768 scaling 1.3330053300533 mm width 271 mm height 203 $ perl -MTcl::pTk::TkHijack pm11129491.pl screen name :0.0 pixel width 1024 pixel height 768 scaling 1.3330053300533 mm width 271 mm height 203

screenmmheigh tracks to https://iweb.dl.sourceforge.net/project/tcl/Tcl/8.6.11/tk8.6.11.1-src.tar.gz

$ ack -ri HeightMMOfScreen tk8.6.11 -B1 tk8.6.11\generic\tkCmds.c 843- WidthMMOfScreen(screenPtr) = width; 844: HeightMMOfScreen(screenPtr) = height; -- 1485- Tcl_SetObjResult(interp, 1486: Tcl_NewIntObj(HeightMMOfScreen(Tk_Screen(tkwin)))); tk8.6.11\unix\tkUnixEvent.c 201- } 202: if (HeightMMOfScreen(DefaultScreenOfDisplay(display)) <= 0) { -- 205- mm = HeightOfScreen(DefaultScreenOfDisplay(display)) * (25.4 / + 75.0); 206: HeightMMOfScreen(DefaultScreenOfDisplay(display)) = mm; tk8.6.11\xlib\X11\Xlib.h 115-#define WidthMMOfScreen(s) ((s)->mwidth) 116:#define HeightMMOfScreen(s) ((s)->mheight)

I recognize that 25.4micron = 0.001 inch = 0.0254 mm

#!/usr/bin/perl -- use strict; use warnings; use Wx(); my $name = Wx::Display->new->GetName; my $dc = Wx::ScreenDC->new; my( $width, $height ) = $dc->GetSizeWH ; my $scaling = ' ??? '; my $ppi = join ' x ', $dc->GetPPI->GetHeight, $dc->GetPPI->GetWidth; my( $widthmm , $heightmm ) = $dc->GetSizeMMWH(); print <<EOT; screen name $name pixel width $width pixel height $height scaling $scaling ppi $ppi mm width $widthmm mm height $heightmm EOT __END__ screen name \\.\DISPLAY1 pixel width 1024 pixel height 768 scaling ??? ppi 96 x 96 mm width 280 mm height 210

The mm width/height seem close enough, the 7-9 mm difference could be the BLACK margin borders of my display. I recall adjusting margins on monitors years ago.

As best I can tell with a ruler , not counting the black borders, my mm height is closer to 205mm , so neither tk 203 nor wx 210 are exact


In reply to Re: Tk screen and monitor size in mm, DPI and scaling ( Wx ) by Anonymous Monk
in thread Tk screen and monitor size in mm, DPI and scaling by Discipulus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.