Yast UI
YIntField Class Reference

Numeric limited range input field. More...

Detailed Description

Numeric limited range input field.

Following widget variants exist: IntField

IntField(label, minValue, maxValue, initialValue)

A numeric input field for integer numbers within a limited range. This can be considered a lightweight version of the {Slider} widget, even as a replacement for this when the specific UI doesn't support the Slider. Remember it always makes sense to specify limits for numeric input, even if those limits are very large (e.g. +/- MAXINT).

Fractional numbers are currently not supported.

Example:

# encoding: utf-8
module Yast
class IntField1Client < Client
def main
Yast.import "UI"
UI.OpenDialog(
VBox(
IntField("Percentage:", 0, 100, 50),
PushButton(Opt(:default), "&OK")
)
)
UI.UserInput
UI.CloseDialog
nil
end
end
end
Yast::IntField1Client.new.main

Example:

# encoding: utf-8
# Simple IntField example
module Yast
class IntField2Client < Client
def main
Yast.import "UI"
UI.OpenDialog(
VBox(
IntField(Id(:perc), "Percentage:", 0, 100, 50),
PushButton(Opt(:default), "&OK")
)
)
UI.ChangeWidget(:perc, :Value, 42)
UI.UserInput
@percentage = Convert.to_integer(UI.QueryWidget(:perc, :Value))
UI.CloseDialog
UI.OpenDialog(
VBox(
Label(Builtins.sformat("You entered: %1%%", @percentage)),
PushButton(Opt(:default), "&OK")
)
)
UI.UserInput
UI.CloseDialog
nil
end
end
end
Yast::IntField2Client.new.main
how widget look like:
IntField1.png
another example:
IntField2.png

The documentation for this class was generated from the following file: