UI Script
from pyfbsdk import *
from pyfbsdk_additions import *
import os
# 创建按钮调用函数
def BtnCallbackTranslation(control, event):
#自己的脚本路径
MyStr=('E:\TEST.py')
execfile(MyStr)
def PopulateLayout(mainLyt):
x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(0,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
# 让窗口一直显示
mainLyt.AddRegion("main","main", x, y, w, h)
lyt = FBHBoxLayout()
mainLyt.SetControl("main",lyt)
# 新建button
b = FBButton()
# button重命名
b.Caption = "Tramslation"
b.Justify = FBTextJustify.kFBTextJustifyLeft
lyt.Add(b,60)
# button点击事件调用函数
b.OnClick.Add(BtnCallbackTranslation)
# 创建工具(会在菜单栏的Python Tool生成一个工具,名字为Rotation and T