Module: Atk::Value

Defined in:
(unknown)

Overview

The ATK interface implemented by valuators and components which display or select a value from a bounded range of values.

Atk::Value should be implemented for components which either display a value from a bounded range, or which allow the user to specify a value from a bounded range, or both. For instance, most sliders and range controls, as well as dials, should have Atk::Object representations which implement Atk::Value on the component's behalf. At::KValues may be read-only, in which case attempts to alter the value return would fail.

A level bar whose value changes to reflect the battery charge. The color remains the same regardless of the charge and there is no on-screen text reflecting the fullness of the battery. In this case, because the position within the bar is the only indication the user has of the current charge, value text should not be provided by the implementor.

Instance Method Summary collapse

Instance Method Details

#current_value=(value) ⇒ Boolean

Sets the value of this object.

Parameters:

  • value (GObject::Value)

    a #GValue which is the desired new accessible value.

Returns:

  • (Boolean)

    true if new value is successfully set, false otherwise.

#get_current_value(obj, value) ⇒ nil

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

  • value (GObject::Value)

    a #GValue representing the current accessible value

Returns:

  • (nil)

#get_increment(obj) ⇒ Float

object may be changed. zero if undefined.

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

Returns:

  • (Float)

    the minimum increment by which the value of this

#get_maximum_value(obj, value) ⇒ nil

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

  • value (GObject::Value)

    a #GValue representing the maximum accessible value

Returns:

  • (nil)

#get_minimum_increment(obj, value) ⇒ nil

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

  • value (GObject::Value)

    a #GValue representing the minimum increment by which the accessible value may be changed

Returns:

  • (nil)

#get_minimum_value(obj, value) ⇒ nil

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

  • value (GObject::Value)

    a #GValue representing the minimum accessible value

Returns:

  • (nil)

#get_range(obj) ⇒ Atk::Range

that represents the minimum, maximum and descriptor (if available) of obj. NULL if that range is not defined.

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

Returns:

  • (Atk::Range)

    a newly allocated Atk::Range

#get_sub_ranges(obj) ⇒ GLib::SList<Atk::Range>

Atk::Range which each of the subranges defined for this object. Free the returns list with g_slist_free().

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

Returns:

  • (GLib::SList<Atk::Range>)

    an #GSList of

#get_value_and_text(obj, value, text) ⇒ nil

readable text alternative for value

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

  • value (Float)

    address of #gdouble to put the current value of obj

  • text (String)

    address of #gchar to put the human

Returns:

  • (nil)

#incrementFloat

Gets the minimum increment by which the value of this object may be changed. If zero, the minimum increment is undefined, which may mean that it is limited only by the floating point precision of the platform. object may be changed. zero if undefined.

Returns:

  • (Float)

    the minimum increment by which the value of this

#rangeAtk::Range

Gets the range of this object. that represents the minimum, maximum and descriptor (if available) of obj. NULL if that range is not defined.

Returns:

  • (Atk::Range)

    a newly allocated Atk::Range

#set_current_value(obj, value) ⇒ Boolean

Returns true if new value is successfully set, false otherwise.

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

  • value (GObject::Value)

    a #GValue which is the desired new accessible value.

Returns:

  • (Boolean)

    true if new value is successfully set, false otherwise.

#set_value(obj, new_value) ⇒ nil

Parameters:

  • obj (Atk::Value)

    a GObject instance that implements AtkValueIface

  • new_value (Float)

    a double which is the desired new accessible value.

Returns:

  • (nil)

#sub_rangesGLib::SList<Atk::Range>

Gets the list of subranges defined for this object. See Atk::Value introduction for examples of subranges and when to expose them. Atk::Range which each of the subranges defined for this object. Free the returns list with g_slist_free().

Returns:

  • (GLib::SList<Atk::Range>)

    an #GSList of

#value=(new_value) ⇒ nil

Sets the value of this object.

This method is intended to provide a way to change the value of the object. In any case, it is possible that the value can't be modified (ie: a read-only component). If the value changes due this call, it is possible that the text could change, and will trigger an Atk::Value::value-changed signal emission.

Note for implementors: the deprecated atk_value_set_current_value() method returned TRUE or FALSE depending if the value was assigned or not. In the practice several implementors were not able to decide it, and returned TRUE in any case. For that reason it is not required anymore to return if the value was properly assigned or not.

Parameters:

  • new_value (Float)

    a double which is the desired new accessible value.

Returns:

  • (nil)