1
2
3
4
5
6
7
8
9
10
11
12from pyfbsdk import *
13from pyfbsdk_additions import *
14
15
16def CloseCallback(control, event):
17 CloseTool(globalTool)
18
19
20def PopulateLayout(mainLyt):
21
23 b.Caption = "Close Me!"
24
25 x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
26 y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
27 w = FBAddRegionParam(50,FBAttachType.kFBAttachNone,"")
28 h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
29
30 mainLyt.AddRegion("Btn","Btn", x, y, w, h)
31 mainLyt.SetControl("Btn",b)
32
33 b.OnClick.Add(CloseCallback)
34
35
36def CreateTool():
37
38 global globalTool
39 globalTool = FBCreateUniqueTool("Close Tool Example")
40 globalTool.StartSizeX = 200
41 globalTool.StartSizeY = 100
42 PopulateLayout(globalTool)
43 ShowTool(globalTool)
44
45
46CreateTool()
47