GtkLabel                package:RGtk2                R Documentation

_G_t_k_L_a_b_e_l

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

     A widget that displays a small to medium amount of text

_M_e_t_h_o_d_s _a_n_d _F_u_n_c_t_i_o_n_s:

     'gtkLabelNew(str = NULL, show = TRUE)'
      'gtkLabelSetText(object, str)'
      'gtkLabelSetAttributes(object, attrs)'
      'gtkLabelSetMarkup(object, str)'
      'gtkLabelSetMarkupWithMnemonic(object, str)'
      'gtkLabelSetPattern(object, pattern)'
      'gtkLabelSetJustify(object, jtype)'
      'gtkLabelSetEllipsize(object, mode)'
      'gtkLabelSetWidthChars(object, n.chars)'
      'gtkLabelSetMaxWidthChars(object, n.chars)'
      'gtkLabelGet(object)'
      'gtkLabelParseUline(object, string)'
      'gtkLabelSetLineWrap(object, wrap)'
      'gtkLabelSetLineWrapMode(object, wrap.mode)'
      'gtkLabelGetLayoutOffsets(object)'
      'gtkLabelGetMnemonicKeyval(object)'
      'gtkLabelGetSelectable(object)'
      'gtkLabelGetText(object)'
      'gtkLabelNewWithMnemonic(str = NULL, show = TRUE)'
      'gtkLabelSelectRegion(object, start.offset, end.offset)'
      'gtkLabelSetMnemonicWidget(object, widget)'
      'gtkLabelSetSelectable(object, setting)'
      'gtkLabelSetTextWithMnemonic(object, str)'
      'gtkLabelGetAttributes(object)'
      'gtkLabelGetJustify(object)'
      'gtkLabelGetEllipsize(object)'
      'gtkLabelGetWidthChars(object)'
      'gtkLabelGetMaxWidthChars(object)'
      'gtkLabelGetLabel(object)'
      'gtkLabelGetLayout(object)'
      'gtkLabelGetLineWrap(object)'
      'gtkLabelGetLineWrapMode(object)'
      'gtkLabelGetMnemonicWidget(object)'
      'gtkLabelGetSelectionBounds(object)'
      'gtkLabelGetUseMarkup(object)'
      'gtkLabelGetUseUnderline(object)'
      'gtkLabelGetSingleLineMode(object)'
      'gtkLabelGetAngle(object)'
      'gtkLabelSetLabel(object, str)'
      'gtkLabelSetUseMarkup(object, setting)'
      'gtkLabelSetUseUnderline(object, setting)'
      'gtkLabelSetSingleLineMode(object, single.line.mode)'
      'gtkLabelSetAngle(object, angle)'
      'gtkLabel(str = NULL, show = TRUE)'

_H_i_e_r_a_r_c_h_y:

     GObject
        +----GInitiallyUnowned
              +----GtkObject
                    +----GtkWidget
                          +----GtkMisc
                                +----GtkLabel
                                      +----GtkAccelLabel
                                      +----GtkTipsQuery 

_I_n_t_e_r_f_a_c_e_s:

     GtkLabel implements AtkImplementorIface and  'GtkBuildable'.

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

     The 'GtkLabel' widget displays a small amount of text. As the name
     implies, most labels are used to label another widget such as a
     'GtkButton', a 'GtkMenuItem', or a 'GtkOptionMenu'.

_M_n_e_m_o_n_i_c_s:

     Labels may contain mnemonics. Mnemonics are underlined characters
     in the label, used for keyboard navigation. Mnemonics are created
     by providing a string with an underscore before the mnemonic
     character, such as '"_File"', to the functions
     'gtkLabelNewWithMnemonic' or 'gtkLabelSetTextWithMnemonic'.

     Mnemonics automatically activate any activatable widget the label
     is inside, such as a 'GtkButton'; if the label is not inside the
     mnemonic's target widget, you have to tell the label about the
     target using 'gtkLabelSetMnemonicWidget'. Here's a simple example
     where the label is inside a button:


     # Pressing Alt-H will activate this button
     button <- gtkButton()
     label <- gtkLabelNewWithMnemonic("_Hello")
     button$add(label)

     There's a convenience function to create buttons with a mnemonic
     label  already inside:


     # Pressing Alt+H will activate this button
     button <- gtkButtonNewWithMnemonic("_Hello")

     To create a mnemonic for a widget alongside the label, such as a 
     'GtkEntry', you have to point the label at the entry with 
     'gtkLabelSetMnemonicWidget':


     # Pressing Alt+H will focus the entry
     entry <- gtkEntry()
     label <- gtkLabelNewWithMnemonic("_Hello")
     label$setMnemonicWidget(entry)


_M_a_r_k_u_p (_s_t_y_l_e_d _t_e_x_t):

     To make it easy to format text in a label (changing colors, fonts,
     etc.), label text can be provided in a simple markup format.
     Here's how to create a label with a small font:


     label <- gtkLabelNew()
     label$setMarkup("<small>Small text</small>")

     (See complete documentation of available tags in the Pango
     manual.)

     The markup passed to 'gtkLabelSetMarkup' must be valid; for
     example, literal </>/& characters must be escaped as &lt;, &gt;,
     and &amp;. If you pass text obtained from the user, file, or a
     network to 'gtkLabelSetMarkup', you'll want to escape it with
     'gMarkupEscapeText()' or 'gMarkupPrintfEscaped()'.

     Markup strings are just a convenient way to set the
     'PangoAttrList' on a label; 'gtkLabelSetAttributes' may be a
     simpler way to set attributes in some cases. Be careful though;
     'PangoAttrList' tends to cause internationalization problems,
     unless you're applying attributes to the entire string (i.e.
     unless you set the range of each attribute to [0, G_MAXINT)). The
     reason is that specifying the start_index and end_index for a
     'PangoAttribute' requires knowledge of the exact string being
     displayed, so translations will cause problems.

_S_e_l_e_c_t_a_b_l_e _l_a_b_e_l_s:

     Labels can be made selectable with 'gtkLabelSetSelectable'. 
     Selectable labels allow the user to copy the label contents to 
     the clipboard. Only labels that contain useful-to-copy information
     - such as error messages - should be made selectable.

_T_e_x_t _l_a_y_o_u_t:

     A label can contain any number of paragraphs, but will have
     performance problems if it contains more than a small number.
     Paragraphs are separated by newlines or other paragraph separators
     understood by Pango.

     Labels can automatically wrap text if you call
     'gtkLabelSetLineWrap'. 'gtkLabelSetJustify' sets how the lines in
     a label align  with one another. If you want to set how the label
     as a whole  aligns in its available space, see
     'gtkMiscSetAlignment'.

_S_t_r_u_c_t_u_r_e_s:


     '_G_t_k_L_a_b_e_l' This should not be accessed directly.  Use the accessor
          functions as described below.


_C_o_n_v_e_n_i_e_n_t _C_o_n_s_t_r_u_c_t_i_o_n:

     'gtkLabel' is the result of collapsing the constructors of
     'GtkLabel' ('gtkLabelNew', 'gtkLabelNewWithMnemonic') and accepts
     a subset of its arguments matching the required arguments of one
     of its delegate constructors.

_S_i_g_n_a_l_s:


     '_c_o_p_y-_c_l_i_p_b_o_a_r_d(_l_a_b_e_l, _u_s_e_r._d_a_t_a)' _undocumented _

          '_l_a_b_e_l' ['GtkLabel'] the object which received the signal.

          '_u_s_e_r._d_a_t_a' [R object] user data set when the signal handler
               was connected.


     '_m_o_v_e-_c_u_r_s_o_r(_l_a_b_e_l, _a_r_g_1, _a_r_g_2, _a_r_g_3, _u_s_e_r._d_a_t_a)' _undocumented _

          '_l_a_b_e_l' ['GtkLabel'] the object which received the signal.

          '_a_r_g_1' ['GtkMovementStep'] 

          '_a_r_g_2' [integer] 

          '_a_r_g_3' [logical] 

          '_u_s_e_r._d_a_t_a' [R object] user data set when the signal handler
               was connected.


     '_p_o_p_u_l_a_t_e-_p_o_p_u_p(_l_a_b_e_l, _a_r_g_1, _u_s_e_r._d_a_t_a)' _undocumented _

          '_l_a_b_e_l' ['GtkLabel'] the object which received the signal.

          '_a_r_g_1' ['GtkMenu'] 

          '_u_s_e_r._d_a_t_a' [R object] user data set when the signal handler
               was connected.


_P_r_o_p_e_r_t_i_e_s:


     '_a_n_g_l_e' [_n_u_m_e_r_i_c : _R_e_a_d / _W_r_i_t_e] The angle that the baseline of
          the label makes with the horizontal, in degrees, measured
          counterclockwise. An angle of 90 reads from from bottom to
          top, an angle of 270, from top to bottom. Ignored if the
          label is selectable, wrapped, or ellipsized.  

          Allowed values: [0,360]  Default value: 0  Since  2.6


     '_a_t_t_r_i_b_u_t_e_s' ['_P_a_n_g_o_A_t_t_r_L_i_s_t' : _R_e_a_d / _W_r_i_t_e] A list of style
          attributes to apply to the text of the label.


     '_c_u_r_s_o_r-_p_o_s_i_t_i_o_n' [_i_n_t_e_g_e_r : _R_e_a_d] The current position of the
          insertion cursor in chars.  Allowed values: >= 0  Default
          value: 0


     '_e_l_l_i_p_s_i_z_e' ['_P_a_n_g_o_E_l_l_i_p_s_i_z_e_M_o_d_e' : _R_e_a_d / _W_r_i_t_e] The preferred
          place to ellipsize the string, if the label does  not have
          enough room to display the entire string, specified as a 
          'PangoEllisizeMode'. 

          Note that setting this property to a value other than 
          'PANGO_ELLIPSIZE_NONE' has the side-effect that the label
          requests  only enough space to display the ellipsis "...". In
          particular, this  means that ellipsizing labels do not work
          well in notebook tabs, unless  the tab's '"tab-expand"'
          property is set to 'TRUE'. Other ways to set a label's width
          are 'gtkWidgetSetSizeRequest' and 'gtkLabelSetWidthChars'.  

          Default value: PANGO_ELLIPSIZE_NONE  Since  2.6


     '_j_u_s_t_i_f_y' ['_G_t_k_J_u_s_t_i_f_i_c_a_t_i_o_n' : _R_e_a_d / _W_r_i_t_e] The alignment of the
          lines in the text of the label relative to each other. This
          does NOT affect the alignment of the label within its
          allocation. See GtkMisc::xalign for that.  Default value:
          GTK_JUSTIFY_LEFT


     '_l_a_b_e_l' [_c_h_a_r_a_c_t_e_r : _R_e_a_d / _W_r_i_t_e] The text of the label.  Default
          value: NULL


     '_m_a_x-_w_i_d_t_h-_c_h_a_r_s' [_i_n_t_e_g_e_r : _R_e_a_d / _W_r_i_t_e] The desired maximum
          width of the label, in characters. If this property  is set
          to -1, the width will be calculated automatically, otherwise
          the  label will request space for no more than the requested
          number of  characters. If the '"width-chars"' property is set
          to a positive  value, then the "max-width-chars" property is
          ignored.  

          Allowed values: >= -1  Default value: -1  Since  2.6


     '_m_n_e_m_o_n_i_c-_k_e_y_v_a_l' [_n_u_m_e_r_i_c : _R_e_a_d] The mnemonic accelerator key
          for this label.  Default value: 16777215


     '_m_n_e_m_o_n_i_c-_w_i_d_g_e_t' ['_G_t_k_W_i_d_g_e_t' : _R_e_a_d / _W_r_i_t_e] The widget to be
          activated when the label's mnemonic key is pressed.


     '_p_a_t_t_e_r_n' [_c_h_a_r_a_c_t_e_r : _W_r_i_t_e] A string with _ characters in
          positions correspond to characters in the text to underline. 
          Default value: NULL


     '_s_e_l_e_c_t_a_b_l_e' [_l_o_g_i_c_a_l : _R_e_a_d / _W_r_i_t_e] Whether the label text can
          be selected with the mouse.  Default value: FALSE


     '_s_e_l_e_c_t_i_o_n-_b_o_u_n_d' [_i_n_t_e_g_e_r : _R_e_a_d] The position of the opposite
          end of the selection from the cursor in chars.  Allowed
          values: >= 0  Default value: 0


     '_s_i_n_g_l_e-_l_i_n_e-_m_o_d_e' [_l_o_g_i_c_a_l : _R_e_a_d / _W_r_i_t_e] Whether the label is
          in single line mode. In single line mode, the height of the
          label does not depend on the actual text, it is always set to
          ascent + descent of the font. This can be an advantage in
          situations where resizing the label because of text  changes
          would be distracting, e.g. in a statusbar.  

          Default value: FALSE  Since  2.6


     '_u_s_e-_m_a_r_k_u_p' [_l_o_g_i_c_a_l : _R_e_a_d / _W_r_i_t_e] The text of the label
          includes XML markup. See pango_parse_markup().  Default
          value: FALSE


     '_u_s_e-_u_n_d_e_r_l_i_n_e' [_l_o_g_i_c_a_l : _R_e_a_d / _W_r_i_t_e] If set, an underline in
          the text indicates the next character should be used for the
          mnemonic accelerator key.  Default value: FALSE


     '_w_i_d_t_h-_c_h_a_r_s' [_i_n_t_e_g_e_r : _R_e_a_d / _W_r_i_t_e] The desired width of the
          label, in characters. If this property is set to -1, the
          width will be calculated automatically, otherwise the label
          will request either 3 characters or the property value,
          whichever is greater. If the "width-chars" property is set to
          a positive value, then the  '"max-width-chars"' property is
          ignored.  

          Allowed values: >= -1  Default value: -1  Since  2.6


     '_w_r_a_p' [_l_o_g_i_c_a_l : _R_e_a_d / _W_r_i_t_e] If set, wrap lines if the text
          becomes too wide.  Default value: FALSE


     '_w_r_a_p-_m_o_d_e' ['_P_a_n_g_o_W_r_a_p_M_o_d_e' : _R_e_a_d / _W_r_i_t_e] If line wrapping is
          on (see the '"wrap"' property) this controls  how the line
          wrapping is done. The default is 'PANGO_WRAP_WORD', which 
          means wrap on word boundaries.  

          Default value: PANGO_WRAP_WORD  Since  2.10


_A_u_t_h_o_r(_s):

     Derived by RGtkGen from GTK+ documentation

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://developer.gnome.org/doc/API/2.0/gtk/GtkLabel.html>

