View Full Version : vizdlg Panel Size
Martina
03-24-2016, 06:44 AM
Hi,
I'm looking to get the size of an auto-scaled vizdlg Panel (I need its length and height). Is there a way to do this?
Best,
Martina
I'm not sure but will look into it. Can you post example code you're using to scale the panel?
Use the Panel.getBoundingBox method to get the panel dimensions:
import viz
import vizshape
import vizdlg
viz.go()
myPanel = vizdlg.Panel(align=viz.ALIGN_LEFT_BOTTOM)
row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,bord er=False,background=False,margin=0)
row.addItem(viz.addText('Textbox'))
textbox = row.addItem(viz.addTextbox())
myPanel.addItem(row)
circle = vizshape.addCircle(parent=viz.ORTHO,scale=[20,20,1],color=viz.RED)
def showPanelDimensions():
box = myPanel.getBoundingBox()
width = box.width
height = box.height
print width,height
circle.setPosition([width,height,0])
myPanel.setPanelScale(2)
showPanelDimensions()
vBulletin® v3.8.7, Copyright ©2000-2025, vBulletin Solutions, Inc.