Function

Gimprange_estimate_settings

Declaration [src]

void
gimp_range_estimate_settings (
  gdouble lower,
  gdouble upper,
  gdouble* step,
  gdouble* page,
  gint* digits
)

Description [src]

This function proposes reasonable settings for increments and display digits. These can be used for instance on GtkRange or other widgets using a GtkAdjustment typically. Note that it will never return digits with value 0. If you know that your input needs to display integer values, there is no need to set digits.

There is no universal answer to the best increments and number of decimal places. It often depends on context of what the value is meant to represent. This function only tries to provide sensible generic values which can be used when it doesn’t matter too much or for generated GUI for instance. If you know exactly how you want to show and interact with a given range, you don’t have to use this function.

Parameters

lower

Type: gdouble

The lower value.

upper

Type: gdouble

The higher value.

step

Type: gdouble*

The proposed step increment.

The argument will be set by the function.
The argument can be NULL.
page

Type: gdouble*

The proposed page increment.

The argument will be set by the function.
The argument can be NULL.
digits

Type: gint*

The proposed decimal places precision.

The argument will be set by the function.
The argument can be NULL.