See also my PerspectiveControls library to save/restore TLW positions,
size, etc...:
http://xoomer.virgilio.it/infinity77/main/PersistentControls.html
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html <==
In almost all cases I know of the OS still maps multiple video cards to
the extended desktop metaphor.
>
> I am assuming that you are using configuration #2. I can't locate a
> "*Place-this control-on-this-video-adapter-screen*" function in
> wxDisplay or wx.Display. If you already can do this why can't you save
> the display number associated with the control for later use ?
>
> *Please share this technique with all of us.*
wx.Display gives you all the information you need. You can get the
number of displays and the geometry and client area of each of them.
You can also get the display number that a particular window is
positioned on. To place a window on a specific display you simply get
that display's geometry and position the window within that rectangle.
>>> import wx
>>> for idx in range(wx.Display.GetCount()):
... d = wx.Display(idx)
... print d.IsPrimary(), d.GetGeometry()
...
True (0, 0, 1920, 1200)
False (-1600, 0, 1600, 1200)
>>>
As you can see from the above, I have a 1920x1200 display located at the
virtual (0,0) that is my primary display (where the OSX Dock and menubar
are located) and a 1600x1200 display positioned on the left of the
primary (indicated by the negative x position).
Yes, although it can of course be more complicated than that... For
probably 98% of the use cases however it boils down to one of two scenarios:
* One (possibly virtual) desktop, spread across N screens where N >= 1
* One (possibly virtual) desktop that is mirrored between two sets of N
screens.
We don't have to worry about display mirroring, because as far as the
applications are concerned there is only one desktop. So all we really
need to be concerned with is that the valid screen real estate may be
split into more than one screen. If it matters to your app you may want
to do things like ensure that the position and size of your frame that
was saved the last time it was run are still a valid position and size,
and adjust it if not. Or if you want to explicitly take advantage of
multiple screens you may just move your frames to each screen
programatically.
BTW, the other 2% of situations that come to mind are things like
applications that take advantage of the client/server nature of
X-Windows and open the display of some other machine or X-server (IOW,
an independent desktop) and explicitly put windows there.
>
> I think you know now why I am confused. It was confusing just to ask
> these questions.
>
> And, on top of this screen coordinate virtualization process, your
> WX/OSX system reports a _negative_ (!) primary-screen offset. How does
> it know that this monitor is _located on the left side_ of the primary
> monitor ??? I.e., what is the meaning/purpose of negative offset values ?
>
My primary display is the first one listed, and its upper-left
coordinate is (0,0) (position a in the diagram). Since I've told the OS
that my secondary monitor is positioned to the left of my primary then
its upper-left point is (-1600, 0) (position b in the diagram). If I
had told the OS that it was positioned above my primary then it would be
(0, -1200). This way when the mouse is on the left edge of my primary
screen, and I move it 1 pixel to the left, it then appears to be on the
right edge of the secondary screen and will be located at point (-1, y).
+---------------+----------------------+
|b |a |
| | |
| | |
| | |
| | |
+---------------+----------------------+