from pyfbsdk import *
from pyfbsdk_additions import *
def CloseCallback(control, event):
CloseTool(globalTool)
def PopulateLayout(mainLyt):
b = FBButton()
b.Caption = "Close Me!"
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(50,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion("Btn","Btn", x, y, w, h)
mainLyt.SetControl("Btn",b)
b.OnClick.Add(CloseCallback)
def CreateTool():
global globalTool
globalTool = CreateUniqueTool("Close Tool Example")
globalTool.StartSizeX = 200
globalTool.StartSizeY = 100
PopulateLayout(globalTool)
ShowTool(globalTool)
CreateTool()