Good morning all! I have a project that uses the following startup script to get an ignition display on each monitor. The problem I am having is that when I tried to use this script to pop up my header/footer and a main page - it seemed to completely break. The only way I could get around this was to change all my main displays to include the header/footer
Does anyone have advice on how to make this work?
Existing script:
Can you post your code as text, inside preformatted text blocks?
```python
-your code here-
``â`
Also, what does âcompletely breaksâ mean - are any errors displayed?
1 Like
Yes sorry Ill do that! I meant to get a screenshot of the problem but got side tracked yesterday. It doesnt error out, just stacks all 3 displays on each other and distorts the sizing if I remember correctly. Ill get a screenshot
# Get the screen information for all of your monitors.
screensDataset = system.gui.getScreens()
# Open the first window of the project in the (current) primary monitor.
screenIndex = screensDataset[0][0]
monitorNum = screenIndex + 1
primaryScreenText = 'This is Monitor %d' %monitorNum
system.nav.swapTo('Dry Plant Overview', {'Display':primaryScreenText})
# Step through all of the screen information, starting with index 1 instead of 0.
for screenDetails in screensDataset[1:]:
# unpacks the tuple that is returned for each of the monitors present. Consists of screen index, width, and height of the screen.
screenIndex, screenWidth, screenHeight = screenDetails
monitorNum = screenIndex + 1
screenText = "This is Monitor %d" %monitorNum
# Open an empty frame on the next monitor.
# Assign a handle and apply the width/height for the monitor you are opening on
handleName = "Monitor %d" %monitorNum
system.gui.openDesktop(screen=screenIndex, handle=handleName, width=screenWidth, height=screenHeight)
# Open the Main Window on this new desktop and pass the parameters needed.
system.nav.desktop(handleName).openWindow('Loadout', {'Display':screenText})
system.nav.desktop(handleName).openWindow('Footer-1080P', {'Display':screenText})
system.nav.desktop(handleName).openWindow('Header-1080P', {'Display':screenText})
I was able to fix this - the problem was I was using the âswaptoâ command instead of the âopenwindowâ command. All works now!
2 Likes