#include <gtkmm.h>

class App
  : public Gtk::Application
{
public:
  static Glib::RefPtr<Gtk::Application> s_app;

  static Glib::RefPtr<Gtk::Application> create(int & argc, char **& argv)
    {
      return s_app = Glib::RefPtr<Gtk::Application>(new App(argc, argv));
    }
private:
  App(int & argc, char **& argv)
    : Gtk::Application(argc, argv, "aurimas.sample")
    {
      add_action(Gio::SimpleAction::create("test-action"));
    }

};

Glib::RefPtr<Gtk::Application> App::s_app;


void startup()
{
  auto win = new Gtk::ApplicationWindow(App::s_app);
  win->add_action(Gio::SimpleAction::create("test-action"));
  win->lookup_action("test-action");   //  <------THIS LINE CAUSES TROUBLE
  win->show();
}


int main(int argc, char **argv)
{
  Glib::RefPtr<Gtk::Application> app = App::create(argc, argv);
  app->signal_startup().connect(sigc::ptr_fun(startup));
  return app->run();
}

