Class: TECSCDE::CellPluginDialog

Inherits:
Object
  • Object
show all
Defined in:
lib/tecscde/cell_plugin_dialog.rb

Instance Method Summary collapse

Constructor Details

#initialize(cell) ⇒ CellPluginDialog

CellPluginDialog#initialize

cell::TmCell



56
57
58
59
# File 'lib/tecscde/cell_plugin_dialog.rb', line 56

def initialize(cell)
  @cell = cell
  setup
end

Instance Method Details

#runObject



61
62
63
64
65
66
67
# File 'lib/tecscde/cell_plugin_dialog.rb', line 61

def run
  @dialog.show_all
  @dialog.run do |response|
    TECSCDE.logger.info(response)
  end
  @dialog.destroy
end

#setupObject



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/tecscde/cell_plugin_dialog.rb', line 69

def setup
  @builder = Gtk::Builder.new
  @builder.add_from_file(File.join(__dir__, "cell_plugin_dialog.glade"))

  @dialog = @builder["dialog_cell_plugin"]

  @label_cell_name = @builder["label_cell_name"]
  @label_cell_name.text = @cell.get_name.to_s

  @button_ok = @builder["button_ok"]
  @button_ok.signal_connect("clicked") do |_me|
    @dialog.response(Gtk::Dialog::RESPONSE_OK)
  end

  @button_cancel = @builder["button_cancel"]
  @button_cancel.signal_connect("clicked") do |_me|
    @dialog.response(Gtk::Dialog::RESPONSE_CANCEL)
  end
end