Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.45 MB, 96 trang )
sterAs( )
method), and the remote object to connect to
(as specified by the objId( ) of the DCOPObject.
The DCOPRef class can then use call( ) to call remote functions.
ref = DCOPRef.new("appname" ,"objname" )
ref.call("someFunction" ) # objname.someFunction
ref.call("someFunction()" ) #objname.someFunction
ref.call("someFunction()" ,"arg" ) # objname.someFunction(arg)
F ridays
BOOKLEET ©
Report erratum
84
C HAPTER 8. K ORUNDUM
DCOP—I NTERPROCESS C OMMUNICATION
For methods that have no return value, there is the send( ) method.
ref = DCOPRef.new("appname" ,"objname" )
ref.send("someFunction" ,"arg" ) # objname.someFunction(arg)
DCOP Signals
DCOP has signals, just like Qt. We can make remote signal/slot connections in a very similiar manner. Consider the following program:
require 'Korundum'