Class: XlibObj::Event::ClientMessage
- Inherits:
-
Object
- Object
- XlibObj::Event::ClientMessage
- Defined in:
- lib/event/client_message.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
writeonly
Sets the attribute data.
-
#subject ⇒ Object
writeonly
Sets the attribute subject.
-
#type ⇒ Object
writeonly
Sets the attribute type.
Instance Method Summary collapse
-
#initialize(type = nil, data = nil, subject = nil) ⇒ ClientMessage
constructor
A new instance of ClientMessage.
- #send_to(receiver) ⇒ Object
Constructor Details
#initialize(type = nil, data = nil, subject = nil) ⇒ ClientMessage
Returns a new instance of ClientMessage.
12 13 14 15 16 |
# File 'lib/event/client_message.rb', line 12 def initialize(type=nil, data=nil, subject=nil) self.type = type self.data = data self.subject = subject end |
Instance Attribute Details
#data=(value) ⇒ Object (writeonly)
Sets the attribute data
18 19 20 |
# File 'lib/event/client_message.rb', line 18 def data=(value) @data = value end |
#subject=(value) ⇒ Object (writeonly)
Sets the attribute subject
18 19 20 |
# File 'lib/event/client_message.rb', line 18 def subject=(value) @subject = value end |
#type=(value) ⇒ Object (writeonly)
Sets the attribute type
18 19 20 |
# File 'lib/event/client_message.rb', line 18 def type=(value) @type = value end |
Instance Method Details
#send_to(receiver) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/event/client_message.rb', line 20 def send_to(receiver) raise "The client message needs a type at least." unless @type @receiver = receiver Xlib.XSendEvent(@receiver.display.to_native, @receiver.to_native, false, Xlib::SubstructureNotifyMask | Xlib::SubstructureRedirectMask, to_native) ensure Xlib::X.flush(@receiver.display) end |