Class: Panel

Inherits:
Gtk::VBox
  • Object
show all
Defined in:
lib/gui/panel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePanel

Returns a new instance of Panel.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gui/panel.rb', line 6

def initialize
  super true, 2

  @tf_pomodoro = TextField.new "Pomodoro time: ", "25"
  @tf_pause = TextField.new "Pause time: ", "5"
  @tf_break = TextField.new "Break time: ", "30"
  @tf_cycles = TextField.new "How many pomodoros until break? ", "2"
  @hb_buttons = Gtk::HBox.new true, 10
  @button_start = ButtonStart.new "Start!"
  @button_cancel = ButtonCancel.new "Cancel"
  @progress_bar = ProgressBar.new

  @hb_buttons.add @button_start
  @hb_buttons.add @button_cancel

  self.add @tf_pomodoro
  self.add @tf_pause
  self.add @tf_break
  self.add @tf_cycles
  self.add @hb_buttons
  self.add @progress_bar
end

Instance Attribute Details

#button_startObject (readonly)

Returns the value of attribute button_start.



3
4
5
# File 'lib/gui/panel.rb', line 3

def button_start
  @button_start
end

#hb_startObject (readonly)

Returns the value of attribute hb_start.



3
4
5
# File 'lib/gui/panel.rb', line 3

def hb_start
  @hb_start
end

#progress_barObject (readonly)

Returns the value of attribute progress_bar.



3
4
5
# File 'lib/gui/panel.rb', line 3

def progress_bar
  @progress_bar
end

#tf_breakObject (readonly)

Returns the value of attribute tf_break.



3
4
5
# File 'lib/gui/panel.rb', line 3

def tf_break
  @tf_break
end

#tf_cyclesObject (readonly)

Returns the value of attribute tf_cycles.



3
4
5
# File 'lib/gui/panel.rb', line 3

def tf_cycles
  @tf_cycles
end

#tf_pauseObject (readonly)

Returns the value of attribute tf_pause.



3
4
5
# File 'lib/gui/panel.rb', line 3

def tf_pause
  @tf_pause
end

#tf_pomodoroObject (readonly)

Returns the value of attribute tf_pomodoro.



3
4
5
# File 'lib/gui/panel.rb', line 3

def tf_pomodoro
  @tf_pomodoro
end