class Iup::Dial
Creates a dial for setting an angular variable.
Example
The following creates a horizontal dial which updates a label whenever its value changes.
Iup::Dial.new do |d| d.valuechanged_cb = ->{ label.title = "dial value: #{'%0.2f' % d.value}" Iup::DEFAULT } end
Attributes
Value one of ‘horizontal’ / ‘vertical’ / ‘circular’. Horizontal or vertical orientations show a dial to be scrolled across; a circular orientation shows a round dial to be rotated.
‘radians’ / ‘degrees’ - used in the callbacks.
Angular value of dial in radians. Except for circular dials, the value resets to 0 when interaction begins.
Public Class Methods
Source
# File lib/wrapped/dial.rb, line 22 def initialize(orientation = 'horizontal') open_controls @handle = ControlsLib.IupDial(orientation) # run any provided block on instance, to set up further attributes yield self if block_given? end
Creates a new instance. If a block is given, the new instance is yielded to it.
-
orientation- ‘horizontal’ / ‘vertical’ / ‘circular’
Callbacks
Attributes
Called each time the user moves the dial with the mouse button pressed. Callback must respond to call and is a 1-argument function: (angle)
-
angle- the dial value, converted according tounit.
Called after the value was interactively changed by the user. Callback must respond to call and take no arguments.