Listing 5

struct after_browse : unique_event<after_browse> {
  after_browse(bool ok, bool is_file, std::string path)
    : ok(ok), is_file(is_file), path(path) {}
  bool ok;
  bool is_file;
  std::string path;
};

// handle the after_browse event
handle_event on_browse(after_browse::arg a) {
  if ( a->ok) ...;
  return event_ex<after_browse>().HANDLED_BY(&me::on_browse);
}