summaryrefslogtreecommitdiffstats
path: root/Tests/FindGTK2/sigc++/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FindGTK2/sigc++/main.cpp')
-rw-r--r--Tests/FindGTK2/sigc++/main.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/FindGTK2/sigc++/main.cpp b/Tests/FindGTK2/sigc++/main.cpp
new file mode 100644
index 0000000..78428e7
--- /dev/null
+++ b/Tests/FindGTK2/sigc++/main.cpp
@@ -0,0 +1,30 @@
+// Taken from https://developer.gnome.org/libsigc++-tutorial/stable/ch02.html
+
+
+#include <sigc++/sigc++.h>
+#include <iostream>
+
+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;
+}