Class: Gtk::Scale
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#add_mark(value, position, markup) ⇒ nil
Adds a mark at value.
-
#clear_marks ⇒ nil
Removes any marks that have been added.
-
#digits ⇒ Integer
The number of decimal places that are displayed in the value.
-
#digits=(digits) ⇒ Integer
The number of decimal places that are displayed in the value.
-
#draw_value ⇒ Boolean
Returns whether the current value is displayed as a string next to the slider.
-
#draw_value=(draw_value) ⇒ Boolean
Whether the current value is displayed as a string next to the slider.
-
#draw_value? ⇒ Boolean
Whether the current value is displayed as a string next to the slider.
-
#get_layout_offsets(x, y) ⇒ nil
Obtains the coordinates where the scale will draw the
PangoLayoutrepresenting the text in the scale. -
#has_origin ⇒ Boolean
Returns whether the scale has an origin.
-
#has_origin=(has_origin) ⇒ Boolean
Whether the scale has an origin.
-
#has_origin? ⇒ Boolean
Whether the scale has an origin.
-
#initialize(orientation, min, max, step) ⇒ Gtk::Widget
constructor
Creates a new scale widget with a range from min to max.
-
#layout ⇒ Pango::Layout
Gets the
PangoLayoutused to display the scale. -
#set_format_value_func(func, user_data, destroy_notify) ⇒ nil
func allows you to change how the scale value is displayed.
-
#value_pos ⇒ Gtk::PositionType
The position in which the current value is displayed.
-
#value_pos=(value_pos) ⇒ Gtk::PositionType
The position in which the current value is displayed.
Methods inherited from Range
#adjustment, #adjustment=, #fill_level, #fill_level=, #flippable, #flippable=, #get_range_rect, #get_slider_range, #inverted, #inverted=, #inverted?, #restrict_to_fill_level, #restrict_to_fill_level=, #restrict_to_fill_level?, #round_digits, #round_digits=, #set_increments, #set_range, #show_fill_level, #show_fill_level=, #show_fill_level?, #slider_size_fixed, #slider_size_fixed=, #value, #value=
Methods inherited from Widget
#accessible_role, #accessible_role=, #action_set_enabled, #activate, #activate_action, #activate_action_variant, #activate_default, #activate_signal, #activate_signal=, #activate_signal_from_name=, #add_binding, #add_binding_action, #add_binding_signal, #add_controller, #add_css_class, #add_mnemonic_label, #add_shortcut, #add_tick_callback, #allocate, #allocated_baseline, #allocated_height, #allocated_width, #baseline, #bind_template_callback_full, #bind_template_child, #bind_template_child_full, #can_focus, #can_focus=, #can_focus?, #can_target, #can_target=, #can_target?, #child_focus, #child_visible, #child_visible=, #children, #clipboard, #compute_bounds, #compute_expand, #compute_point, #compute_transform, #contains, #create_pango_context, #create_pango_layout, #css_classes, #css_classes=, #css_name, #css_name=, #cursor, #cursor=, #cursor_from_name=, default_direction, default_direction=, #direction, #direction=, #display, #dispose_template, #drag_check_threshold, #error_bell, #first_child, #focus_child, #focus_child=, #focus_on_click, #focus_on_click=, #focus_on_click?, #focusable, #focusable=, #focusable?, #font_map, #font_map=, #font_options, #font_options=, #frame_clock, #get_allocation, #get_ancestor, #get_color, #get_preferred_size, #get_size, #get_size_request, #get_template_child, #grab_focus, #halign, #halign=, #has_css_class, #has_default, #has_default=, #has_default?, #has_focus, #has_focus=, #has_focus?, #has_tooltip, #has_tooltip=, #has_tooltip?, #has_visible_focus, have_template?, #height, #height_request, #height_request=, #hexpand, #hexpand=, #hexpand?, #hexpand_set, #hexpand_set=, #hexpand_set?, #hide, #in_destruction, #init_template, #insert_action_group, #insert_action_group_raw, #insert_after, #insert_before, #install_action, #install_property_action, #is_ancestor, #is_drawable, #is_focus, #is_sensitive, #is_visible, #keynav_failed, #last_child, #layout_manager, #layout_manager=, #layout_manager_type, #layout_manager_type=, #list_mnemonic_labels, #map, #mapped, #margin_bottom, #margin_bottom=, #margin_end, #margin_end=, #margin_start, #margin_start=, #margin_top, #margin_top=, #measure, #mnemonic_activate, #name, #name=, #native, #next_sibling, #observe_children, #observe_controllers, #opacity, #opacity=, #overflow, #overflow=, #pango_context, #parent, #parent=, #pick, #prev_sibling, #primary_clipboard, #query_action, #queue_allocate, #queue_draw, #queue_resize, #realize, #realized, #receives_default, #receives_default=, #receives_default?, #remove_controller, #remove_css_class, #remove_mnemonic_label, #remove_tick_callback, #request_mode, #root, #root=, #scale_factor, #scale_factor=, #sensitive, #sensitive=, #sensitive?, #set_size_request, #set_size_request_raw, #set_state_flags, #set_template, #set_template_raw, #settings, #should_layout, #show, #size_allocate, #snapshot_child, #state_flags, #style_context, #style_context_raw, #template=, template_children, #template_from_resource=, #template_scope=, #tooltip_markup, #tooltip_markup=, #tooltip_text, #tooltip_text=, #translate_coordinates, #translate_coordinates_raw, #trigger_tooltip_query, #unmap, #unparent, #unrealize, #unset_state_flags, #valign, #valign=, #vexpand, #vexpand=, #vexpand?, #vexpand_set, #vexpand_set=, #vexpand_set?, #visible, #visible=, #visible?, #width, #width_request, #width_request=
Constructor Details
#initialize(orientation, min, max, step) ⇒ Gtk::Widget
Creates a new scale widget with a range from min to max.
The returns scale will have the given orientation and will let the user input a number between min and max (including min and max) with the increment step. step must be nonzero; it’s the distance the slider moves when using the arrow keys to adjust the scale value.
Note that the way in which the precision is derived works best if step is a power of ten. If the resulting precision is not suitable for your needs, use [methodGtk.Scale.set_digits] to correct it.
Instance Method Details
#add_mark(value, position, markup) ⇒ nil
Adds a mark at value.
A mark is indicated visually by drawing a tick mark next to the scale, and GTK makes it easy for the user to position the scale exactly at the marks value.
If markup is not nil, text is shown next to the tick mark.
To remove marks from a scale, use [methodGtk.Scale.clear_marks].
#clear_marks ⇒ nil
Removes any marks that have been added.
#digits ⇒ Integer
The number of decimal places that are displayed in the value.
#digits=(digits) ⇒ Integer
The number of decimal places that are displayed in the value.
#draw_value ⇒ Boolean
Returns whether the current value is displayed as a string next to the slider.
#draw_value=(draw_value) ⇒ Boolean
Whether the current value is displayed as a string next to the slider.
#draw_value? ⇒ Boolean
Whether the current value is displayed as a string next to the slider.
#get_layout_offsets(x, y) ⇒ nil
Obtains the coordinates where the scale will draw the
PangoLayout representing the text in the scale.
Remember when using the PangoLayout function you need to
convert to and from pixels using PANGO_PIXELS() or PANGO_SCALE.
If the [propertyGtk.Scale:draw-value] property is false, the return values are undefined.
#has_origin ⇒ Boolean
Returns whether the scale has an origin.
#has_origin=(has_origin) ⇒ Boolean
Whether the scale has an origin.
#has_origin? ⇒ Boolean
Whether the scale has an origin.
#layout ⇒ Pango::Layout
Gets the PangoLayout used to display the scale.
The returned object is owned by the scale so does not need to be freed by the caller.
#set_format_value_func(func, user_data, destroy_notify) ⇒ nil
func allows you to change how the scale value is displayed.
The given function will return an allocated string representing value. That string will then be used to display the scale's value.
If #NULL is passed as func, the value will be displayed on its own, rounded according to the value of the [propertyGtk.Scale:digits] property.
#value_pos ⇒ Gtk::PositionType
The position in which the current value is displayed.
#value_pos=(value_pos) ⇒ Gtk::PositionType
The position in which the current value is displayed.