Is it possible to dock a window to a corner, like the north west corner in my case
Nope. Do you have a motivating example?
I just have a banner i want to open/close on a push of the home button and i want it to be placed in the north west corner. I can place it based on the size of the windows, but if the resolution of the screen if larger or smaller, it is placed improperly
Do you want it overlapping your other windows? If so, docking isn’t what you want.
If you’re placing something in the upper left, it shouldn’t have a problem with screen resolution. Upper left corner is (0,0) - thats the origin of the coordinate scheme.
Am I missing something?
Yeah i meant north east, or upper right corner. I do want it on top of all the windows. This si for a banner, which has things like time, user, and some static buttons. i also have a window which is docked south for the static nav buttons.
You can put it in the north east when you open it like this:
win = fpmi.nav.openWindow("MyWindow")
app = win.parent
win.setLocation(app.width-win.width,0)
The trick here is that a window’s “parent” is the project workspace itself.
Hope this helps,
Ok, i put this in an internalFrameOpen event for my main window
try:
win = fpmi.gui.getWindow("Banner")
except ValueError:
win = fpmi.nav.openWindow("Banner")
app = win.parent
def later(app = app, win = win):
win.setLocation(app.width-win.width,0)
fpmi.system.invokeLater(later)
Thanks for the suggestion Carl
Carl, I have a problem with this script. It is on another window that has the banner on top of it. I am trying to make the trend visible in the banner. How do i reference items in another window in jython?
def rtTrendOpen(event):
import fpmi
win = fpmi.gui.getWindow('Banner')
chart = win.getComponent('RT Trend')
banner = win.getComponent('Banner')
#banner.visible = 0
#chart.visible = 1
#chart.Tag = event.source.Tag
You don’t call .getComponent() directly on the window. You need to get into the root container first, like this
def rtTrendOpen(event):
import fpmi
win = fpmi.gui.getWindow('Banner')
chart = win.rootContainer.getComponent('RT Trend')
banner = win.rootContainer.getComponent('Banner')
#banner.visible = 0
#chart.visible = 1
#chart.Tag = event.source.Tag