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 #### $ 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) #### #!/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 <