glabel               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_h_a_t  _s_h_o_w _t_e_x_t _o_r _i_m_a_g_e_s

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

     A label, button or graphic show basic bits of text or images in a
     widget. Each of these can have a handler assigned for when the
     widget is clicked.

     Labels show text. The text can be marked up. An option is
     available so that the displayed text can be edited. 

     Buttons show text and/or images in a clickable object whose
     shading indicates that the button is to clicked on.

     Images can be shown.

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

     glabel(text = "", markup = FALSE, editable = FALSE, handler = NULL,
     action = NULL, container = NULL, ..., toolkit = guiToolkit())

     gbutton(text = "", border=TRUE, handler = NULL, action = NULL, container = NULL, 
         ..., toolkit = guiToolkit()) 

     gimage(filename = "", dirname = "",  size = "", 
         handler = NULL, action = NULL, container = NULL, ..., toolkit = guiToolkit()) 

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

    text: Text to show in the label or button. For buttons, if this
          text matches a stock icon name, an icon is shown as well

  border: If 'TRUE' a border is drawn to make a button look like a
          button. If 'FALSE', the no border so the button looks like a
          label.

  markup: Logical indicating if text for a label uses markup 

editable: Logical. If TRUE, then the label's text can be set by
          clicking on the label and filling in the edit box. 

filename: Specifies location of image. May be a stock icon name or
          filename. 

 dirname: Directory of file. If "stock", then a stock icon is used.

    size: Size of image when stock image is used. Values are in
          'c("menu",
          "small_toolbar","large_toolbar","button","dialog")'

 handler: Handler called on a click 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 value of the widget. For a
     label, this is the text. For a button, the same. For an image, it
     is the filename of the figure or the stock icon name, if the icon
     was set from a stock icon.

     The 'svalue<-()' method can be used to set the value of the
     widget. For an image, the value is a filename containing the image
     to display.

     The 'addhandlerclicked' method is called on click events.

     For labels, if 'editable=TRUE' is specified, clicking on the text
     allows one to edit the label's value overriding the click handler
     in the process. However, the 'addhandlerchanged' handler can be
     given to respond to the text after it has been chnaged.

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

     ## Not run: 
        glabel("a label", container=TRUE)
        glabel("Click me to edit label", editable=TRUE, container=TRUE)
        glabel("Click me for a message", container=TRUE,
        handler=function(h,...) {cat("Hi\n")})
     ## End(Not run)

