WideStudio/MWT Logo
WideStudio/MWT
Programming Guide
WideStudio/MWT Index
Table of contents


获取子对象

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

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





获取指定的子对象

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

let event_procedure obj =
  (* 获得指定名称的子对象 *)
  let child = obj -> getChildInstance ("newvbtn_001") in
  if (get_int (child) <> 0) then
    (* 访问指定的子对象 *)
    ignore(child -> setVisible ( _True ));

  ()
let _ = Callback.register "event_procedure" event_procedure

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

Document Release 3.90 for WideStudio/MWT ver 3.90, Jul 2005


WideStudio/MWT documents index | Table of contents

Copyright(C) WideStudio/MWT Development Team, 1999-2005 Last modified: Jul 31, 2005