Class: Watobo::Gui::SidTable

Inherits:
FXTable
  • Object
show all
Defined in:
lib/watobo/gui/session_management_dialog.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner, opts) ⇒ SidTable

Returns a new instance of SidTable.


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/watobo/gui/session_management_dialog.rb', line 41

def initialize(owner, opts)
  super(owner, opts)
  @request = nil
  @event_dispatcher_listeners = Hash.new
  initTable()

  self.connect(SEL_COMMAND, method(:onTableClick))

  self.columnHeader.connect(SEL_COMMAND) do |sender, sel, index|
    self.fitColumnsToContents(index)
  end
  
  Watobo::SIDCache.acquire(Thread.current.object_id).sids.each_key do |site|
     addSID(site, new_sids[site])
  end
end

Instance Method Details

#clearEvents(event) ⇒ Object


30
31
32
# File 'lib/watobo/gui/session_management_dialog.rb', line 30

def clearEvents(event)
  @event_dispatcher_listener[event].clear
end

#subscribe(event, &callback) ⇒ Object


26
27
28
# File 'lib/watobo/gui/session_management_dialog.rb', line 26

def subscribe(event, &callback)
  (@event_dispatcher_listeners[event] ||= []) << callback
end

#updateSID_UNUSED(new_sids = {}) ⇒ Object


34
35
36
37
38
39
# File 'lib/watobo/gui/session_management_dialog.rb', line 34

def updateSID_UNUSED(new_sids = {})
  initTable()
  new_sids.each_key do |site|
    addSID(site, new_sids[site])
  end
end