summaryrefslogtreecommitdiffstats
path: root/Tests/FindGTK2/sigc++/main.cpp
blob: 4dae4f433536a4f3ba11956de7e69291ce1a84b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Taken from https://developer.gnome.org/libsigc++-tutorial/stable/ch02.html

#include <iostream>

#include <sigc++/sigc++.h>

class AlienDetector
{
public:
  AlienDetector() {}

  void run() {}

  sigc::signal<void> signal_detected;
};

void warn_people()
{
  std::cout << "There are aliens in the carpark!" << std::endl;
}

int main()
{
  AlienDetector mydetector;
  mydetector.signal_detected.connect(sigc::ptr_fun(warn_people));

  mydetector.run();

  return 0;
}