from pyfbsdk import *
from pyfbsdk_additions import *
def BtnRadioCallback(control, event):
print control.Caption, " has been clicked!"
def PopulateLayout(mainLyt):
group = ButtonGroup()
group.AddCallback(BtnRadioCallback)
anchor = ""
attachType = FBAttachType.kFBAttachTop
for i in range(5):
name = "BtnRadio " + str(i)
b = FBButton()
group.Add(b)
b.Caption = name
b.Style = FBButtonStyle.kFBRadioButton
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,attachType,anchor)
w = FBAddRegionParam(100,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion(name,name, x, y, w, h)
mainLyt.SetControl(name,b)
attachType = FBAttachType.kFBAttachBottom
anchor = name
def CreateTool():
t = CreateUniqueTool("Radiobox Example")
PopulateLayout(t)
ShowTool(t)
CreateTool()