ggroup               package:gWidgets               R Documentation

_C_o_n_t_a_i_n_e_r_s _f_o_r _p_a_c_k_i_n_g _i_n _s_u_b_s_e_q_u_e_n_t _w_i_d_g_e_t_s

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

     A 'ggroup' is the primary container for packing in subsequent
     widgets, either from left to right or top to bottom. Widgets are
     packed in using the 'add' method and can be removed with the
     'delete' method.

     The 'gframe' and 'gexpandgroup' widgets add a label to the group
     and in the latter case an arrow for hiding/showing the group.

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

     ggroup(horizontal = TRUE, spacing = 5,  use.scrollwindow = FALSE, container = NULL, ..., toolkit = guiToolkit())

     gframe(text = "", markup = FALSE, pos = 0, horizontal=TRUE, container = NULL, 
         ..., toolkit = guiToolkit()) 
     gexpandgroup(text = "", markup = FALSE, horizontal=TRUE, handler = NULL, action = NULL, 
         container = NULL, ..., toolkit = guiToolkit())

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

horizontal: Specifies if widgets are packed in left to right or top to
          bottom ('FALSE')

 spacing: Space in pixels around each widget. Can be changed with
          'svalue'

    text: Text for label

  markup: Optional markup. (See 'glabel' for details.)

     pos: Where to place label: 0 is to left, 1 to right, interpolates.

 handler: Called when expand arrow is clicked

  action: Passed to handler

use.scrollwindow: If 'TRUE' then group is placed in a scrollwindow
          allowing panning with mouse.

container: Optional container to attach widget to

     ...: For 'gframe', 'gexpandgroup' these are passed along to
          'ggroup'

 toolkit: Which GUI toolkit to use

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

     The groups pack in widgets from either left to right (when
     'horizontal=TRUE') or from top to bottom (when
     'horizontal=FALSE'). 

     The 'spacing' value determines the number of pixels of padding
     between each widget. This can be set when the group is
     constructed, or later using 'svalue'. 

     The 'svalue<-' method can be used to adjust the border width. By
     default it is 2 pixels.

     To put  space between just two widgets, the 'addSpace(obj, value,
     ...)' method may be used where 'value' is the number of pixels of
     padding between the just packed widget, and the next one to be
     packed.

     Widgets are packed together like blocks.  When packing from top to
     bottom, the width of each widget can either be the natural size of
     the widget (the default), or if the 'expand=TRUE' argument is
     given to the 'add' method the widget will expand to fill the
     possible space.

     The 'addSpring(obj,...)' method will push the just packed widget
     and the next-to-be packed widget as far apart as possible.

     In 'gWidgetsRGtk2' a few arguments add to the container. The
     argument 'raise.on.dragmotion = TRUE' will cause the group to jump
     to the foreground when a drag action crosses it. The argument
     'use.scrollwindow = TRUE' will put the group

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

     ## Not run: 
       ## basic group
       group = ggroup(horizontal=FALSE, container=gwindow())
       add(group, glabel("widget 1"))
       add(group, gbutton("widget 2"))

       ## nested groups
       group = ggroup(horizontal=FALSE, container=gwindow())
       innergroup = ggroup(container = group)
       add(innergroup, gbutton("button 1"))
       add(innergroup, gbutton("button 2"))
       add(group, gtext("Text area"))

       ## expand argument
       group = ggroup(horizontal=FALSE, container=gwindow())
       add(group,gbutton("no expand"))
       add(group,gbutton("expand=TRUE"), expand=TRUE)

       ## add spring
       group = ggroup(container=gwindow("menubar-like example"))
       add(group, glabel("File",handler=function(h,...) print("file")))
       add(group, glabel("Edit",handler=function(h,...) print("edit")))
     addSpring(group)                                   
       add(group, glabel("Help",handler=function(h,...) print("help")))

     ## End(Not run)

