下面是运行截图
from xcgui import *
XInitXCGUI("") #初始化UI库
XPy_Init() #初始化UI库Py支持
hWindow =0
hLayoutContent=0
hCurPanel=0
def SwitchTab(strTy):
global hCurPanel
if hCurPanel:
XEle_Destroy(hCurPanel)
if "登陆"==strTy:
hCurPanel = XC_LoadLayout("panel-login.xml",hLayoutContent)
XEle_SetTextColor(XC_GetObjectByName("登陆"),0xFFFFFF,255)
XEle_SetTextColor(XC_GetObjectByName("注册"),0x000000,255)
else:
hCurPanel = XC_LoadLayout("panel-reg.xml",hLayoutContent)
XEle_SetTextColor(XC_GetObjectByName("登陆"),0x000000,255)
XEle_SetTextColor(XC_GetObjectByName("注册"),0xFFFFFF,255)
XWnd_AdjustLayout(hWindow)
XWnd_Redr