Am 15.07.2016 um 11:59 schrieb MartinLemburg@Siemens-PLM:
>>>>>>> is there a way on MS Windows, without using TWAPI to get the monitor/screen a Tk window is displayed on?
>> Pleas look to the usage of vrootwidth etc. An example is in the dynhelp
>> code of bwidgets:
>>
>>
https://core.tcl.tk/bwidget/artifact/fe5b9d560cf3f3de
>>
>> See function:
>> DynamicHelp::_show_help
>> which cares to place the dynamic help totally on the screen where the
>> item is.
> BTW the position of a Tk window shows, that my second monitor only extends the desktop on the first monitor.
It is not Tk. It is your windows settings.
If you have two physical monitors (prim/sec), you can position them
within windows on a virtual screen over all of your physical monitors.
See the multi screen settings of your computer.
> But the virtual root window is always in (0, 0)?
No.
(0,0) on the virtual screen is the upper-left corner of your primary
physical screen.
If your second monitor is configured to be left of the primary monitor,
the vrootx gets negative.
If your second screens upper edge is above the primary screen, vrooty
gets negative.
Otherwise, it is 0,0
> And the screen width/height is always 1920x1080, even if I have only
one "screen":
This is the size of your primary screen. It is independent on any
secondary screen.
> % winfo x .; # . on the left side of second monitor
> 1920
> % winfo screen
> :0.0
> % winfo x .; # . on the left side of the first monitor aligned to the taskbar
> 128
> % winfo screen
> :0.0
Get away from the notion of "screen" if you use windows in virtual
screen mode. It is always ":0.0", for all monitors. Windows works with
one big virtual pane, where the monitors show you parts of it. There are
invisible parts and you can configure (in windows) that there is space
between the monitors.
Use coordinates, best returned by "wm geometry .".