Created
July 29, 2013 20:28
-
-
Save mudgen/6107523 to your computer and use it in GitHub Desktop.
Customizing component layouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from com.inductiveautomation.factorypmi.application.components.util import FPMILayout | |
| layout = component.getClientProperty(FPMILayout.LAYOUT_CONSTRAINTS) | |
| layout.setFlags(FPMILayout.ANCHOR_N | FPMILayout.ANCHOR_E | FPMILayout.ANCHOR_W | FPMILayout.ANCHOR_S) | |
| #Here is how to get the designer bounds from the client. Works for any container. Maybe it works for components. Does not work for windows so use the rootContainer. | |
| r = FPMILayout.getPreferredBounds(system.gui.getParentWindow(event).rootContainer) | |
| width, height = int(r.width), int(r.height) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment