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
# File 'src/lib/y2network/dialogs/wireless_networks.rb', line 33

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

Instance Method Details

#handleObject

See Also:

  • CWM::CustomWidget


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

def handle
  @block.call

  nil
end

#labelObject

See Also:

  • CWM::AbstractWidget


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

def label
  @label
end