Class: Y2Network::Dialogs::CallbackButton

Inherits:
CWM::PushButton
  • Object
show all
Defined in:
src/lib/y2network/dialogs/wireless_networks.rb

Overview

Button that runs an custom action when it is clicked

Instance Method Summary collapse

Constructor Details

#initialize(label, &block) ⇒ CallbackButton

Returns a new instance of CallbackButton.

Parameters:

  • label (String)

    Button label

  • block (Proc)

    Action to run



33
34
35
36
37
# File 'src/lib/y2network/dialogs/wireless_networks.rb', line 33

def initialize(label, &block)
  super()
  @label = label
  @block = block
end

Instance Method Details

#handleObject

See Also:

  • CWM::CustomWidget


45
46
47
48
49
# File 'src/lib/y2network/dialogs/wireless_networks.rb', line 45

def handle
  @block.call

  nil
end

#labelObject

See Also:

  • CWM::AbstractWidget


40
41
42
# File 'src/lib/y2network/dialogs/wireless_networks.rb', line 40

def label
  @label
end