Everything works ok, but the form is shown in the same screen that rhino started, but if I swap between my 2 screens (that happens very often), it is a little anoying to find where the form is.
Is it possible to force the opening centered on the current working screen?
if you use a Eto.Forms.Dialog in IronPython it automatically follows the position of the Rhino main window and opens centered on the same screen as Rhino:
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
import Eto
Hi @clement , is there a method for this that you know of?
I’m using this code to place my form at the bottom center of the Rhino Window but this fails on Dual Monitors of course as this method is getting the Main display but not necessarily the Rhino Document screen.
s = Rhino.UI.RhinoEtoApp.MainWindow.Screen
w = s.WorkingArea.Width
h = s.WorkingArea.Height
self.Location = Eto.Drawing.Point((w / 2 - (self.Width / 2)), (h - self.Height + padding)) # Locate Form At Bottom Center Of Screen
I was intrigued about your Dialog statement but I’m doing some logic that (I think?) can only happen with a Form so I’m going that route.
Hi @michaelvollrath, just curious what do you get with below example script if:
Rhino is maximized on the first screen
Rhino is maximized on the second screen
Rhino is not maximized but restored on one of the screens
Rhino is not maximized but restored across both screens
Not sure if this works right for me in all situations, expecially the bottom alignment is way off when Rhino is not maximized. @dale could you enlighten us please ?
Hi @clement , yes it’s also off for me as well so I have tabled it for a moment as I work through other elements but I certainly will be curious to know