I’m trying to create a button that will always be available in the top right corner. It should overlap the other screens so for this reason I think using the built in dock isn’t going to work.
To do this I have created a window that has a layer of 1000 and have placed a button in it.
My target resolution is 1280x1024 since this is what most of our HMIs run on. I set the x and y locations to 1180 and 0 (its 100 pixels wide) and this works well.
The problem is where the screen is running on a resolution that is different i.e. 1600x… On these wider screens the button appears closer towards the middle of the screen.
My question is how can I set it so that this window always appears in the top right corner. I imagine it would involve binding the position but am not sure exactly how to do this.
Can you set the screen position during load? I imagine I have to set the location parameter of the window but am not sure which event to use and how to set this property. Can you do it by passing parameters into the system.nav.openwindow() method?
I can get most of the way there using this code but am getting the error “property ‘Location’ does not exist in window ‘ML/NavigationBar’”
toolkit = java.awt.Toolkit.getDefaultToolkit();
scrnsize = toolkit.getScreenSize();
mywidth = scrnsize.width
mypoint = java.awt.Point(mywidth-100,0)
print "Screen size : " + str(scrnsize.width)
Curious about this as there is a location property listed in the user manual under window properties??