package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Progress_bar/index.html

Module Wrappers.Progress_bar

type t = [ `progress_bar | `widget | `initially_unowned | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new ProgressBar

val set_text : t -> string option -> unit

Causes the given @text to appear next to the progress bar.

If @text is %NULL and property@Gtk.ProgressBar:show-text is %TRUE, the current value of property@Gtk.ProgressBar:fraction will be displayed as a percentage.

If @text is non-%NULL and property@Gtk.ProgressBar:show-text is %TRUE, the text will be displayed. In this case, it will not display the progress percentage. If @text is the empty string, the progress bar will still be styled and sized suitably for containing text, as long as property@Gtk.ProgressBar:show-text is %TRUE.

val set_show_text : t -> bool -> unit

Sets whether the progress bar will show text next to the bar.

The shown text is either the value of the property@Gtk.ProgressBar:text property or, if that is %NULL, the property@Gtk.ProgressBar:fraction value, as a percentage.

To make a progress bar that is styled and sized suitably for containing text (even if the actual text is blank), set property@Gtk.ProgressBar:show-text to %TRUE and property@Gtk.ProgressBar:text to the empty string (not %NULL).

val set_pulse_step : t -> float -> unit

Sets the fraction of total progress bar length to move the bouncing block.

The bouncing block is moved when method@Gtk.ProgressBar.pulse is called.

val set_inverted : t -> bool -> unit

Sets whether the progress bar is inverted.

Progress bars normally grow from top to bottom or left to right. Inverted progress bars grow in the opposite direction.

val set_fraction : t -> float -> unit

Causes the progress bar to “fill in” the given fraction of the bar.

The fraction should be between 0.0 and 1.0, inclusive.

val set_ellipsize : t -> Ocgtk_pango.Pango.ellipsizemode -> unit

Sets the mode used to ellipsize the text.

The text is ellipsized if there is not enough space to render the entire string.

val pulse : t -> unit

Indicates that some progress has been made, but you don’t know how much.

Causes the progress bar to enter “activity mode,” where a block bounces back and forth. Each call to method@Gtk.ProgressBar.pulse causes the block to move by a little bit (the amount of movement per pulse is determined by method@Gtk.ProgressBar.set_pulse_step).

val get_text : t -> string option

Retrieves the text that is displayed with the progress bar.

The return value is a reference to the text, not a copy of it, so will become invalid if you change the text in the progress bar.

val get_show_text : t -> bool

Returns whether the `GtkProgressBar` shows text.

See method@Gtk.ProgressBar.set_show_text.

val get_pulse_step : t -> float

Retrieves the pulse step.

See method@Gtk.ProgressBar.set_pulse_step.

val get_inverted : t -> bool

Returns whether the progress bar is inverted.

val get_fraction : t -> float

Returns the current fraction of the task that’s been completed.

val get_ellipsize : t -> Ocgtk_pango.Pango.ellipsizemode

Returns the ellipsizing position of the progress bar.

See method@Gtk.ProgressBar.set_ellipsize.