Callback bricks

Function and method call-backs

C++ templates => arg. types checked by the compiler

class MyClass {
  void moo(int i) { ... }
  ...
};

void foo(char* s, double d) { ... }


main() {
  MyClass* obj = new MyClass();

  UBox& box = uhbox
  (
    "my button"
    + UOn::mpress / ucall(obj, 5, &MyClass::moo) 
    + UOn::action / ucall("abcd", 3.14, foo)
  );
}