WideStudio Logo
WideStudio
Programming Guide
WideStudio Index
Table of contents


获取子对象

使用如下所示的方法,获取实例中包含的子对象。

获取子对象的成员函数 功能
mpfc.WSCbase getChildInstance(instance_name) 获得指定名称的对象





获取指定的子对象

使用成员函数getChildInstance()获得指定的子对象。

def event_procedure(object):
  # 获得指定名称的子对象
  child = object.getChildInstance("newvbtn_001");
  if (child != None):
    # 访问指定的子对象
    child.setVisible(mpfc.True);
  return
mpfc.WSGFfunctionRegister("event_procedure",event_procedure)

在上例中获得了object中包含的指定子对象。在获取指定名称的子对象时, 对象object对其子对象进行递归检索。如果没有发现指定名称的子对象,则返回None。

Document Release 3.80 for WideStudio ver 3.80, Jan 2005


WideStudio documents index | Table of contents

Copyright(C) WideStudio Development Team, 1999-2005 Last modified: Jan 05, 2005