gslider               package:gWidgets               R Documentation

_C_o_n_s_t_r_u_c_t_o_r_s _f_o_r _w_i_d_g_e_t_s _t_o _s_e_l_e_c_t _a _v_a_l_u_e _f_r_o_m _a _s_e_q_u_e_n_c_e.

_D_e_s_c_r_i_p_t_i_o_n:

     The gslider widget and gspinbutton widget allow the user to select
     a value from a sequence using the mouse. In the slider case, a
     slider is dragged left or right (or up or down) to change the
     value. For a spin button a text box with arrows beside allow the
     user to scroll through the values by clicking the arrows.

_U_s_a_g_e:

     gslider(from = 0, to = 100, by = 1, value = from, horizontal = TRUE, handler = NULL, action = NULL, container = NULL, ..., toolkit = guiToolkit())

     gspinbutton (from = 0, to = 10, by = 1, value = from, digits = 0, 
         handler = NULL, action = NULL, container = NULL, ..., toolkit = guiToolkit()) 

_A_r_g_u_m_e_n_t_s:

    from: Starting point in range

      to: Ending point in range

      by: Step size between values in the sequence

   value: The initial value 

  digits: The number of digits shown

horizontal: Specifies orientation of gslider widget

 handler: Called on a change event.

  action: Passed to handler 

container: Optional container to attach widget to

     ...: ignored

 toolkit: Which GUI toolkit to use

_D_e_t_a_i_l_s:

     The 'svalue' method returns the selected value.

     The 'svalue<-' method is used to set the selected value.

     The 'addhandlerchanged' handler is called when the widgets' value
     is changed.

_E_x_a_m_p_l_e_s:

     ## Not run: 
       x = rnorm(100)
       plotHist = function(shade = .5) hist(x, col=gray(shade))

       group = ggroup(horizontal =FALSE, container=TRUE)
       glabel("Slide value to adjust shade", container=group)
       gslider(from=0,to=1,by=0.05,value=.5, container=group,
       handler=function(h,...)  plotHist(svalue(h$obj)))
     ## End(Not run)

