Class: ChooserListRow

Inherits:
Gtk::ListBoxRow
  • Object
show all
Defined in:
lib/terminal_chooser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(term, index, notebook) ⇒ ChooserListRow

Returns a new instance of ChooserListRow.



187
188
189
190
191
192
193
194
# File 'lib/terminal_chooser.rb', line 187

def initialize(term, index, notebook)
  super()
  @notebook = notebook
  @hbox = Gtk::Box.new(:horizontal, 6)
  fill_hbox_list_box_row(term, index)
  generate_action_button
  add(@hbox)
end

Instance Attribute Details

#close_buttonObject (readonly)

Returns the value of attribute close_button.



186
187
188
# File 'lib/terminal_chooser.rb', line 186

def close_button
  @close_button
end

Instance Method Details

#action_buttonObject



196
197
198
# File 'lib/terminal_chooser.rb', line 196

def action_button
  @hbox.children[4]
end

#generate_new_action_button(label) ⇒ Object



200
201
202
203
204
205
206
207
208
# File 'lib/terminal_chooser.rb', line 200

def generate_new_action_button(label)
  button = Gtk::Button.new(:label => label)
  button.valign = :center
  button.vexpand = false
  @hbox.remove(action_button)
  @hbox.pack_start(button,
                   :expand => false, :fill => false, :padding => 6)
  show_all
end