Module: CWM::ValueBasedWidget

Included in:
CheckBox, ComboBox, DateField, InputField, IntField, MultiLineEdit, Password, RichText, TimeField
Defined in:
library/cwm/src/lib/cwm/common_widgets.rb

Overview

A mix-in for widgets using the :Value property

Instance Method Summary collapse

Instance Method Details

#valueObject

Get widget value

Calling this method only make sense when the widget is displayed (see #displayed?).

Returns:

  • (Object)

    a value according to specific widget type



34
35
36
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 34

def value
  Yast::UI.QueryWidget(Id(widget_id), :Value)
end

#value=(val) ⇒ void

This method returns an undefined value.

Set widget value

Calling this method only make sense when the widget is displayed (see #displayed?).

Parameters:

  • val (Object)

    a value according to specific widget type



44
45
46
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 44

def value=(val)
  Yast::UI.ChangeWidget(Id(widget_id), :Value, val)
end