1
2
3
4
5
6
7
8
9
10
11
12from pyfbsdk import *
13from pyfbsdk_additions import *
14
15def BtnRadioCallback(control, event):
16 print(control.Caption, " has been clicked!")
17
18def PopulateLayout(mainLyt):
19 group = FBButtonGroup()
20 group.AddCallback(BtnRadioCallback)
21 anchor = ""
22 attachType = FBAttachType.kFBAttachTop
23
24 for i in range(5):
25 name =
"BtnRadio " +
str(i)
27 group.Add(b)
28
29 b.Caption = name
30 b.Style = FBButtonStyle.kFBRadioButton
31
32 x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
33 y = FBAddRegionParam(10,attachType,anchor)
34 w = FBAddRegionParam(100,FBAttachType.kFBAttachNone,"")
35 h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
36
37 mainLyt.AddRegion(name,name, x, y, w, h)
38
39 mainLyt.SetControl(name,b)
40
41 attachType = FBAttachType.kFBAttachBottom
42 anchor = name
43
44def CreateTool():
45
46 t = FBCreateUniqueTool("Radiobox Example")
47
48 PopulateLayout(t)
49 ShowTool(t)
50
51
52CreateTool()
53
54
55
Python built-in string class.
Definition: pyfbsdk.h:77