summaryrefslogtreecommitdiffstats
path: root/korundum/rubylib/examples/dcop/dcopsignal.rb
blob: 4e83d7f48e2858074d28687f427178eda22c572f (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
#!/usr/bin/env ruby

require 'Korundum'

class SenderWidget < KDE::PushButton
	k_dcop_signals 'void testEmitSignal(TQString)'
	
	def initialize(parent, name)
		super
		TQt::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()