class Tk::Scale

Public Class Methods

tk_command() click to toggle source
# File lib/ffi-tk/widget/scale.rb, line 6
def self.tk_command
  'scale'
end

Public Instance Methods

coords(value = None) click to toggle source

Returns a list whose elements are the x and y coordinates of the point along the centerline of the trough that corresponds to value. If value is omitted then the scale's current value is used.

# File lib/ffi-tk/widget/scale.rb, line 13
def coords(value = None)
  execute(:coords, value)
end
get(x = None, y = None) click to toggle source

If x and y are omitted, returns the current value of the scale. If x and y are specified, they give pixel coordinates within the widget; the command returns the scale value corresponding to the given pixel. Only one of x or y is used: for horizontal scales y is ignored, and for vertical scales x is ignored.

# File lib/ffi-tk/widget/scale.rb, line 22
def get(x = None, y = None)
  execute(:get, x, y)
end
identify(x, y) click to toggle source

Returns a string indicating what part of the scale lies under the coordinates given by x and y. A return value of slider means that the point is over the slider; trough1 means that the point is over the portion of the slider above or to the left of the slider; and trough2 means that the point is over the portion of the slider below or to the right of the slider. If the point is not over one of these elements, an empty string is returned.

# File lib/ffi-tk/widget/scale.rb, line 34
def identify(x, y)
  execute(:identify, x, y)
end
set(value) click to toggle source

This command is invoked to change the current value of the scale, and hence the position at which the slider is displayed. Value gives the new value for the scale. The command has no effect if the scale is disabled. the button is held down, the action auto-repeats.

# File lib/ffi-tk/widget/scale.rb, line 43
def set(value)
  execute(:set, value)
end