Class: Rabbit::Graffiti::ConfigDialog

Inherits:
Object
  • Object
show all
Includes:
Rabbit::GetText
Defined in:
lib/rabbit/graffiti/config-dialog.rb

Constant Summary

Constants included from Rabbit::GetText

Rabbit::GetText::DOMAIN

Instance Method Summary collapse

Methods included from Rabbit::GetText

included

Constructor Details

#initialize(color, line_width) ⇒ ConfigDialog

Returns a new instance of ConfigDialog.


10
11
12
13
# File 'lib/rabbit/graffiti/config-dialog.rb', line 10

def initialize(color, line_width)
  @original_color = color
  @original_line_width = line_width
end

Instance Method Details

#run(&block) ⇒ Object


15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rabbit/graffiti/config-dialog.rb', line 15

def run(&block)
  @callback = block
  init_dialog
  if @dialog.run == Gtk::ResponseType::OK
    @callback.call(Renderer::Color.new(@dialog.rgba),
                   nil)
  else
    @callback.call(@original_color, @original_line_width)
  end
  @dialog.destroy
end