Class: AudioSwitch::UI

Inherits:
Object
  • Object
show all
Defined in:
lib/audio_switch/ui.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ UI

Returns a new instance of UI.



6
7
8
9
10
# File 'lib/audio_switch/ui.rb', line 6

def initialize(model)
  @model = model
  @menu = Gtk::Menu.new
  @items = []
end

Instance Method Details

#startObject



12
13
14
15
16
17
18
19
20
# File 'lib/audio_switch/ui.rb', line 12

def start
  add_to_tray
  subscribe
  AudioSwitch::LOG.info 'starting GTK main'
  loop do
    Gtk.main
    AudioSwitch::LOG.info 'restarting GTK main'
  end
end