class Iup::Val
An interactive control allowing the user to select a value within a limited range.
Example
The following sets up a vertical control with a range from 0 to 10. As the slider is moved, a label’s title is updated to the current value.
Iup::Val.new('vertical') do |v| t.max = 10 v.valuechanged_cb = ->{ label.title = "VALUE=#{"%0.2f" % v.value}" Iup::DEFAULT } end
Attributes
Enables the control to gain focus. Values ‘yes’ / ‘no’.
Allows button to fill available space in indicated direction. Values ‘no’ / ‘horizontal’ / ‘vertical’ / ‘yes’.
If set, places maximum value on opposite side: values ‘yes’ / ‘no’.
Maximum value, defaults to 1.
Minimum value, defaults to 0.
Orientation of control: ‘horizontal’ / ‘vertical’
Proportion of increment for pageup / pagedown. Value between 0.0 and 1.0, default is 0.1.
Returns position in pixels within client window as “x,y”.
Size of the control, in pixels, value as “widthxheight”.
Returns position in pixels on screen as “x,y”.
Proportion of increment for up / down. Value between 0.0 and 1.0, default is 0.01.
Returns the current value of the control.
Public Class Methods
Source
# File lib/wrapped/val.rb, line 24 def initialize(orientation='horizontal') @handle = IupLib.IupVal(orientation) # run any provided block on instance, to set up further attributes yield self if block_given? end
Creates an instance of the control. If a block is given, the new instance is yielded to it.
-
orientation- ‘horizontal’ / ‘vertical’
Callbacks
Attributes
Calls callback when mouse is used to move control. Callback must respond to call and take no arguments.
Calls callback after the value was interactively changed by the user. Callback must respond to call and take no arguments.