PreviousUpNext

15.3.707  src/lib/x-kit/widget/old/leaf/slider.api

## slider.api
#
# Compare with:
#     src/lib/x-kit/widget/old/leaf/scrollbar.api
#
# A slider lets a user vary an Int value
# by dragging a slidepiece down a groove.
#
# Sample code using sliders:
#
#     src/lib/x-kit/tut/colormixer/colormixer-app.pkg
#     src/lib/x-kit/tut/widget/label-slider.pkg
#     src/lib/x-kit/tut/nbody/animate-sim-g.pkg
 
# Compiled by:
#     src/lib/x-kit/widget/xkit-widget.sublib


# Compiled by:
#     src/lib/x-kit/widget/xkit-widget.sublib





# This api implemented in:
#
#     src/lib/x-kit/widget/old/leaf/slider.pkg

stipulate
    include package   threadkit;                        # threadkit             is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    #
    package wg =  widget;                       # widget                is from   src/lib/x-kit/widget/old/basic/widget.pkg
herein

    api Slider {

        Slider;

        Range = { from:  Int,
                  to:    Int
                };

        make_slider:  (wg::Root_Window, wg::View, List(wg::Arg)) -> Slider;


        as_widget:  Slider -> wg::Widget;

        slider_motion'_of:  Slider -> Mailop( Int );
            #
            # Client -must- read this mailop,
            # otherwise the slider imp will block,
            # freezing the slider display.

        set_slider_value:  Slider -> Int -> Void;
        get_slider_value:  Slider -> Int;
            #
            # Get and set the slider value.
            # Setting its value will move the slider.
            # Setting an out-of-range value raises BAD_ARG.

        get_slider_range:  Slider -> Range;

        set_slider_active_flag:  (Slider, Bool) -> Void;
        get_slider_active_flag:   Slider -> Bool;
    };
end;

## COPYRIGHT (c) 1994 by AT&T Bell Laboratories  See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext