from pyfbsdk import *
from pyfbsdk_additions import *
t = CreateUniqueTool("Attach Example")
b = FBButton()
b.Caption = "But"
x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
t.AddRegion("Btn","Btn", x, y, w, h)
t.SetControl("Btn",b)
b2 = FBButton()
b2.Caption = "But2"
x1 = FBAddRegionParam(5,FBAttachType.kFBAttachRight,"Btn")
y1 = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
w1 = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
h1 = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
t.AddRegion("Btn2","Btn2", x1, y1, w1, h1)
t.SetControl("Btn2",b2)
b3 = FBButton()
b3.Caption = "But3"
x3 = FBAddRegionParam(-45,FBAttachType.kFBAttachRight,"")
y3 = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
w3 = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
h3 = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
t.AddRegion("Btn3","Btn3", x3, y3, w3, h3)
t.SetControl("Btn3",b3)
b4 = FBButton()
b4.Caption = "But4"
x4 = FBAddRegionParam(-45,FBAttachType.kFBAttachLeft,"Btn3")
y4 = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
w4 = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
h4 = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
t.AddRegion("Btn4","Btn4", x4, y4, w4, h4)
t.SetControl("Btn4",b4)
ShowTool(t)