View Single Post
  #3  
Old 03-27-2016, 11:22 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,461
Use the Panel.getBoundingBox method to get the panel dimensions:

Code:
import viz
import vizshape
import vizdlg

viz.go()

myPanel = vizdlg.Panel(align=viz.ALIGN_LEFT_BOTTOM)
row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,border=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()
Reply With Quote