Skip to content

Instantly share code, notes, and snippets.

@mudgen
Created July 29, 2013 20:28
Show Gist options
  • Select an option

  • Save mudgen/6107523 to your computer and use it in GitHub Desktop.

Select an option

Save mudgen/6107523 to your computer and use it in GitHub Desktop.
Customizing component layouts
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