invokeMethod()

Invokes a method of a EWO widget or of a reference created via CTRL++/OOP.

Synopsis

anytype invokeMethod(string|shape object, string methodName, [...]);

Parameters

Parameter Meaning
object The name of the object.
methodName Name of the function that should be invoked.
... All further attributes that are needed for the function (see example below)

Return value

The return value is depending on the invoked function.

Description

With invokeMethod() it is possible to call a function without using the dot notation (e.g. TREE.appendChild()).

  • invokeMethod() can be used for EWO functions and references created via object-oriented panel references and CTRL++ where properties were defined. E.g.
    invokeMethod(name, "setText", name);
  • invokeMethod() also supports in/out parameter e.g. &para

Example

Following example shows how to use various functions of the tree widget only with invokeMethod().

int idx = invokeMethod("TREE2", "addColumn", "xxx");

DebugN(idx);

invokeMethod("TREE2", "appendItem", "", "id1", "text1");

invokeMethod("TREE2", "appendItem", "", "id2", "text2");

DebugN(invokeMethod("TREE2", "selectedItem"));

invokeMethod("TREE2", "setColumnWidth", 0, 250);

shape s = getShape("TREE2");

invokeMethod(s, "appendItem", "", "id3", "text3");

Assignment

-

Availability

UI