summaryrefslogtreecommitdiffstats
path: root/korundum/rubylib/examples/dcop/dcopsignal.rb
diff options
context:
space:
mode:
Diffstat (limited to 'korundum/rubylib/examples/dcop/dcopsignal.rb')
-rwxr-xr-xkorundum/rubylib/examples/dcop/dcopsignal.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/korundum/rubylib/examples/dcop/dcopsignal.rb b/korundum/rubylib/examples/dcop/dcopsignal.rb
new file mode 100755
index 00000000..07a6dfee
--- /dev/null
+++ b/korundum/rubylib/examples/dcop/dcopsignal.rb
@@ -0,0 +1,26 @@
+#!/usr/bin/env ruby
+
+require 'Korundum'
+
+class SenderWidget < KDE::PushButton
+ k_dcop_signals 'void testEmitSignal(QString)'
+
+ def initialize(parent, name)
+ super
+ Qt::Object::connect(self, SIGNAL('clicked()'), self, SLOT('doit()'))
+ end
+
+ slots 'doit()'
+
+ def doit()
+ emit testEmitSignal("Hello DCOP Slot")
+ end
+end
+
+about = KDE::AboutData.new("dcopsignal", "DCOPSignalTest", "0.1")
+KDE::CmdLineArgs.init(ARGV, about)
+a = KDE::UniqueApplication.new()
+signaltest = SenderWidget.new(nil, "foobar") { setText 'DCOP Signal Test' }
+a.mainWidget = signaltest
+signaltest.show()
+a.exec()