Home News DOC Class DL Others Rice
DOC  >  system.cook
system.cook

A script that runs at startup.

The system.cook is a script runs at startup automatically.

If system.cook is in the same directory as Cooker.exe. :

Cooker's browser moves to the home page at the startup. Then, system.cook will be executed just once immediately.

If system.cook defines an end() method, call the end() method when Cooker exits.

If system.cook does not exist :

Nothing happens.

Initial implementation.

The distribution archive contains system.cook. The implementation is shown below.

1:

class main

2:

browser _br;

3:

message _m;

4:

open method void start()

5:

endmethod

6:
7:

open method void end()

8:

endmethod

9:
10:

open method void F1()

11:

_br.LoadUrl("https://www.google.co.jp/");

12:

endmethod

13:

open method void F2()

14:

_br.GoBack();

15:

endmethod

16:

open method void F3()

17:

_br.GoForward();

18:

endmethod

19:

open method void F4()

20:

_m.Icon = 3;

21:

_m.Show("F4() is not implemented.");

22:

endmethod

23~50:

...

51:

open method void F12()

52:

_m.Icon = 3;

53:

_m.Show("F12() is not implemented.");

54:

endmethod

55:

endclass

If the methods F1 () to F12 () are defined, the shortcut keys, Ctrl + F1 to F12, will call the corresponding methods.

If not defined, nothing happens.

In the above code, it is implemented like this:

The browser moves to "https://www.google.co.jp/" in Ctrl + F1.

The browser moves to the previous page in Ctrl + F2.

The browser moves to the next page in Ctrl + F3.

The message is displayed in Ctrl + F4 to F12.

Next
Previous
Copyright © Rice All rights reserved.