A slider showing value, from low to high: true (and value
changed) after the user moved it. format: how the value is shown
(printf's, e.g. '%.0f km'; default '%.4g').
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Gui), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | label |
the text next to it |
||
| real(kind=wp), | intent(inout) | :: | value |
shown, and changed by the user |
||
| real(kind=wp), | intent(in) | :: | low |
the slider's range |
||
| real(kind=wp), | intent(in) | :: | high |
the slider's range |
||
| character(len=*), | intent(in), | optional | :: | format |
printf's (default '%.4g') |
logical function slider(self, label, value, low, high, format) result(changed) class(Gui), intent(inout) :: self character(len=*), intent(in) :: label !! the text next to it real(wp), intent(inout) :: value !! shown, and changed by the user real(wp), intent(in) :: low, high !! the slider's range character(len=*), intent(in), optional :: format !! printf's (default '%.4g') real(c_double) :: v v = value if (present(format)) then changed = vkf_gui_slider(self%handle, label, len(label, kind=c_int), v, real(low, c_double), & real(high, c_double), format, len(format, kind=c_int)) /= 0 else changed = vkf_gui_slider(self%handle, label, len(label, kind=c_int), v, real(low, c_double), & real(high, c_double), '', 0_c_int) /= 0 end if value = v end function slider