class Tk::Event::Data
Constants
- PROPERTIES
Public Class Methods
new(id, pattern, *properties)
click to toggle source
Calls superclass method
# File lib/ffi-tk/event/data.rb, line 45 def initialize(id, pattern, *properties) super id, pattern PROPERTIES.each do |_code, conv, name| value = properties.shift converted = String(value) next if converted == '??' converted = __send__(conv, value) self[name] = converted end end
Public Instance Methods
call()
click to toggle source
# File lib/ffi-tk/event/data.rb, line 57 def call Handler.invoke(id, self) if id end
resend(widget, virtual, changes = {})
click to toggle source
Try to resend the event with as much information preserved as possible. Unfortunately that doesn't seem to be easy.
# File lib/ffi-tk/event/data.rb, line 63 def resend(widget, virtual, changes = {}) original = {} members.each do |name| value = self[name] case name when :id, :pattern, :border_width, :button, :count, :focus, :height, :keycode, :keysym, :keysym_number, :mode, :mousewheel_delta, :override_redirect, :place, :property, :root, :send_event, :subwindow, :type, :unicode, :width, :window, :window_path when :x_root original[:rootx] = value when :y_root original[:rooty] = value when :detail original[name] = value if value else original[name] = value end end Event.generate(widget, virtual, original.merge(changes)) end
sequence()
click to toggle source
# File lib/ffi-tk/event/data.rb, line 91 def sequence Kernel.warn("#{self.class}.sequence deprecated, use #{self.class}.pattern") pattern end
widget()
click to toggle source
# File lib/ffi-tk/event/data.rb, line 87 def widget Tk.widgets[window_path] end