from pyfbsdk import *
from pyfbsdk_additions import *
def ValueChange(control,event):
print control.Value
def Transaction(control,event):
print "Transaction, is begin: ", event.IsBeginTransaction
def PopulateLayout(mainLyt):
x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(0,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"")
mainLyt.AddRegion("main","main", x, y, w, h)
lyt = HBoxLayout()
mainLyt.SetControl('main', lyt)
hs = FBSlider()
hs.Orientation = FBOrientation.kFBHorizontal
hs.SmallStep = 10
hs.LargeStep = 10
hs.OnChange.Add(ValueChange)
hs.OnTransaction.Add(Transaction)
lyt.Add(hs, 150, height=25)
vs = FBSlider()
vs.Orientation = FBOrientation.kFBVertical
lyt.Add(vs, 25, height=150)
def CreateTool():
t = CreateUniqueTool("Slider Example")
t.StartSizeX = 400
t.StartSizeY = 400
PopulateLayout(t)
ShowTool(t)
CreateTool()