Introduction
metaobject-signal-slot are used for communication between objects like Qt.
Usage
MetaObject.connect(sender,signal,receiver,slot);
MetaObject.disconnect(sender,signal,receiver,slot);
Example1
Code
; { return Math;} { console; } { console; }; { thisstate = currentPage: 0 pages: 0 } { console } { thisstatecurrentPage = Math; this; } { thisstatecurrentPage = Math; this; } { thisstatepages = thisstatepages + 1; } { return thisstatepages; } { return thisstatecurrentPage; }; { thisnavigationBar = ; thisscrollView = ; thisscrollView; thisscrollView; thisscrollView; thisscrollView; thisscrollView; this; } { MetaObject; MetaObject; } { ; }; let app = ; app;
Result
onRightButtonPressed
ScrollView updated: 2/5
onRightButtonPressed
ScrollView updated: 3/5
onRightButtonPressed
ScrollView updated: 4/5
onRightButtonPressed
ScrollView updated: 5/5
onLeftButtonPressed
ScrollView updated: 4/5
onLeftButtonPressed
ScrollView updated: 3/5
Example2
Code
{ console; } { console; }; { console; } { console; this; }; { console; } { console; this }; let a1 = ;let a2 = ;let b11 = ;let b12 = ;let c = ; MetaObject;MetaObject;MetaObject;MetaObject;MetaObject; a1;a2;
Result
A.signal(hello)
B.slot(hello)
B.signal(hello,hello)
C.slot(hello,hello)
C.signal(hello,hello,hello,hello)
A.slot(hello,hello,hello,hello)
B.slot(hello)
B.signal(hello,hello)
A.signal(world)
C.slot(world)
C.signal(world,world)
A.slot(world,world)