Home Cooker Classes Others Rice
Classes  >  window  >  Activated(class,string)
window class : Activated(class,string) method

Description

Assigns an event handler to the "Activated" event.

Syntax

windowInstance.Activated(class handleInstance, string signature)

Arguments

ClassNameDescription
classhandleInstanceAn instance with the event handler as a member.
stringsignatureSignature of the event handler.

Return value

ClassDescription
switchA switch that controls the execution of the event handler.

Sample code

Suppose you have the following class definition.

1:

class handle

2:

...

3:

open fitter handle()

4:

// any initialization code...

5:

endfitter

6:

...

7:

open method void handler(switch sw)

8:

// any handling code....

9:

endmethod

10:

...

11:

endclass

Handler assignment is as follows.

1:

window w = new window();

2:

handle h = new handle();

3:

switch ehs = w.Activated(h,"handler(switch)");

4:

ehs.Start(); // Starts handling.

Notes

The handler for this event must be an open method with one argument of the switch class.

In other words, if the method name of the handler is "handlerName", the definition of the handler is as follows.


open method void handlerName(switch sw)

...

endmethod


In this case, the signature of the handler specify by the second argument is "handlerName(switch)".

Links for reference

None

Copyright © Rice All rights reserved.