1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2013, AdaCore                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  A Gtk_Label is a light widget associated with some text you want to 
  32. --  display on the screen. You can change the text dynamically if needed. 
  33. -- 
  34. --  The text can be on multiple lines if you separate each line with the 
  35. --  ASCII.LF character. However, this is not the recommended way to display 
  36. --  long texts (see the Gtk_Text widget instead). 
  37. -- 
  38. --  == Mnemonics == 
  39. -- 
  40. --  Labels may contain mnemonics. Mnemonics are underlined characters in the 
  41. --  label, used for keyboard navigation. Mnemonics are created by providing 
  42. --  string with an underscore before the mnemonic character, such as "_File", 
  43. --  to the functions gtk_new_with_mnemonic or set_text_with_mnemonic(). 
  44. -- 
  45. --  Mnemonics automatically activate any activatable widget the label is 
  46. --  inside, such as a Gtk_Button; if the label is not inside the mnemonic's 
  47. --  target widget, you have to tell the label about the target using 
  48. --  set_mnemonic_widget(). For instance: declare Button : Gtk_Button; Label : 
  49. --  Gtk_Label; begin Gtk_New (Button); Gtk_New_With_Mnemonic (Label, "_File"); 
  50. --  Add (Button, Label); end; However, there exists a convenience function in 
  51. --  Gtk.Button to create such a button already. 
  52. -- 
  53. --  == Markup == 
  54. -- 
  55. --  To make it easy to format text in a label (changing colors, fonts, etc.), 
  56. --  label text can be provided in a simple markup format. Here's how to create 
  57. --  a label with a small font: Gtk_New (Label, "<small>hello</small>"); 
  58. -- 
  59. --  The markup must be valid, and <>& characters must be escaped with &lt; 
  60. --  &gt; and &amp; 
  61. -- 
  62. --  Markup strings are just a convenient way to set the Pango_Attr_List on 
  63. --  label; Set_Attributes() may be a simpler way to set attributes in some 
  64. --  cases. Be careful though; Pango_Attr_List tends to cause 
  65. --  internationalization problems, unless you're applying attributes to the 
  66. --  entire string (i.e. unless you set the range of each attribute to [0, 
  67. --  G_MAXINT)). The reason is that specifying the start_index and end_index for 
  68. --  a Pango_Attribute requires knowledge of the exact string being displayed, 
  69. --  so translations will cause problems. 
  70. -- 
  71. --  == Selectable labels == 
  72. -- 
  73. --  Labels can be made selectable with Set_Selectable. Selectable labels allow 
  74. --  the user to copy the label contents to the clipboard. Only should be made 
  75. --  selectable. 
  76. -- 
  77. --  </description> 
  78. --  <screenshot>gtk-label</screenshot> 
  79. --  <group>Display widgets</group> 
  80. --  <testgtk>create_label.adb</testgtk> 
  81.  
  82. pragma Warnings (Off, "*is already use-visible*"); 
  83. with Glib;             use Glib; 
  84. with Glib.Properties;  use Glib.Properties; 
  85. with Glib.Types;       use Glib.Types; 
  86. with Gtk.Buildable;    use Gtk.Buildable; 
  87. with Gtk.Enums;        use Gtk.Enums; 
  88. with Gtk.Misc;         use Gtk.Misc; 
  89. with Gtk.Widget;       use Gtk.Widget; 
  90. with Pango.Attributes; use Pango.Attributes; 
  91. with Pango.Layout;     use Pango.Layout; 
  92.  
  93. package Gtk.Label is 
  94.  
  95.    type Gtk_Label_Record is new Gtk_Misc_Record with null record; 
  96.    type Gtk_Label is access all Gtk_Label_Record'Class; 
  97.  
  98.    ------------------ 
  99.    -- Constructors -- 
  100.    ------------------ 
  101.  
  102.    procedure Gtk_New (Label : out Gtk_Label; Str : UTF8_String := ""); 
  103.    procedure Initialize 
  104.       (Label : access Gtk_Label_Record'Class; 
  105.        Str   : UTF8_String := ""); 
  106.    --  Creates a new label with the given text inside it. You can pass null to 
  107.    --  get an empty label widget. 
  108.    --  "str": The text of the label 
  109.  
  110.    procedure Gtk_New_With_Mnemonic 
  111.       (Label : out Gtk_Label; 
  112.        Str   : UTF8_String); 
  113.    procedure Initialize_With_Mnemonic 
  114.       (Label : access Gtk_Label_Record'Class; 
  115.        Str   : UTF8_String); 
  116.    --  Creates a new Gtk.Label.Gtk_Label, containing the text in Str. If 
  117.    --  characters in Str are preceded by an underscore, they are underlined. If 
  118.    --  you need a literal underscore character in a label, use '__' (two 
  119.    --  underscores). The first underlined character represents a keyboard 
  120.    --  accelerator called a mnemonic. The mnemonic key can be used to activate 
  121.    --  another widget, chosen automatically, or explicitly using 
  122.    --  Gtk.Label.Set_Mnemonic_Widget. If Gtk.Label.Set_Mnemonic_Widget is not 
  123.    --  called, then the first activatable ancestor of the Gtk.Label.Gtk_Label 
  124.    --  will be chosen as the mnemonic widget. For instance, if the label is 
  125.    --  inside a button or menu item, the button or menu item will automatically 
  126.    --  become the mnemonic widget and be activated by the mnemonic. 
  127.    --  "str": The text of the label, with an underscore in front of the 
  128.    --  mnemonic character 
  129.  
  130.    function Get_Type return Glib.GType; 
  131.    pragma Import (C, Get_Type, "gtk_label_get_type"); 
  132.  
  133.    ------------- 
  134.    -- Methods -- 
  135.    ------------- 
  136.  
  137.    function Get_Angle (Label : access Gtk_Label_Record) return Gdouble; 
  138.    procedure Set_Angle (Label : access Gtk_Label_Record; Angle : Gdouble); 
  139.    --  Sets the angle of rotation for the label. An angle of 90 reads from 
  140.    --  from bottom to top, an angle of 270, from top to bottom. The angle 
  141.    --  setting for the label is ignored if the label is selectable, wrapped, or 
  142.    --  ellipsized. 
  143.    --  Since: gtk+ 2.6 
  144.    --  "angle": the angle that the baseline of the label makes with the 
  145.    --  horizontal, in degrees, measured counterclockwise 
  146.  
  147.    function Get_Attributes 
  148.       (Label : access Gtk_Label_Record) 
  149.        return Pango.Attributes.Pango_Attr_List; 
  150.    procedure Set_Attributes 
  151.       (Label : access Gtk_Label_Record; 
  152.        Attrs : out Pango.Attributes.Pango_Attr_List); 
  153.    --  Sets a Pango.Attributes.Pango_Attr_List; the attributes in the list are 
  154.    --  applied to the label text. 
  155.    --  Note: The attributes set with this function will be applied and merged 
  156.    --  with any other attributes previously effected by way of the 
  157.    --  Gtk.Label.Gtk_Label:use-underline or Gtk.Label.Gtk_Label:use-markup 
  158.    --  properties. While it is not recommended to mix markup strings with 
  159.    --  manually set attributes, if you must; know that the attributes will be 
  160.    --  applied to the label after the markup string is parsed. 
  161.    --  "attrs": a Pango.Attributes.Pango_Attr_List 
  162.  
  163.    function Get_Current_Uri 
  164.       (Label : access Gtk_Label_Record) return UTF8_String; 
  165.    --  Returns the URI for the currently active link in the label. The active 
  166.    --  link is the one under the mouse pointer or, in a selectable label, the 
  167.    --  link in which the text cursor is currently positioned. This function is 
  168.    --  intended for use in a Gtk.Label.Gtk_Label::activate-link handler or for 
  169.    --  use in a Gtk.Widget.Gtk_Widget::query-tooltip handler. not be freed or 
  170.    --  modified. 
  171.    --  Since: gtk+ 2.18 
  172.  
  173.    function Get_Ellipsize 
  174.       (Label : access Gtk_Label_Record) 
  175.        return Pango.Layout.Pango_Ellipsize_Mode; 
  176.    procedure Set_Ellipsize 
  177.       (Label : access Gtk_Label_Record; 
  178.        Mode  : Pango.Layout.Pango_Ellipsize_Mode); 
  179.    --  if there is not enough space to render the entire string. 
  180.    --  Since: gtk+ 2.6 
  181.    --  "mode": a Pango.Layout.Pango_Ellipsize_Mode 
  182.  
  183.    function Get_Justify 
  184.       (Label : access Gtk_Label_Record) return Gtk.Enums.Gtk_Justification; 
  185.    procedure Set_Justify 
  186.       (Label : access Gtk_Label_Record; 
  187.        Jtype : Gtk.Enums.Gtk_Justification); 
  188.    --  Sets the alignment of the lines in the text of the label relative to 
  189.    --  each other. %GTK_JUSTIFY_LEFT is the default value when the widget is 
  190.    --  first created with Gtk.Label.Gtk_New. If you instead want to set the 
  191.    --  alignment of the label as a whole, use Gtk.Misc.Set_Alignment instead. 
  192.    --  Gtk.Label.Set_Justify has no effect on labels containing only a single 
  193.    --  line. 
  194.    --  "jtype": a Gtk.Enums.Gtk_Justification 
  195.  
  196.    function Get_Label (Label : access Gtk_Label_Record) return UTF8_String; 
  197.    procedure Set_Label (Label : access Gtk_Label_Record; Str : UTF8_String); 
  198.    --  Sets the text of the label. The label is interpreted as including 
  199.    --  embedded underlines and/or Pango markup depending on the values of the 
  200.    --  Gtk.Label.Gtk_Label:use-underline" and Gtk.Label.Gtk_Label:use-markup 
  201.    --  properties. 
  202.    --  "str": the new text to set for the label 
  203.  
  204.    function Get_Layout 
  205.       (Label : access Gtk_Label_Record) return Pango.Layout.Pango_Layout; 
  206.    --  Gets the Pango.Layout.Pango_Layout used to display the label. The 
  207.    --  layout is useful to e.g. convert text positions to pixel positions, in 
  208.    --  combination with Gtk.Label.Get_Layout_Offsets. The returned layout is 
  209.    --  owned by the label so need not be freed by the caller. 
  210.  
  211.    procedure Get_Layout_Offsets 
  212.       (Label : access Gtk_Label_Record; 
  213.        X     : out Gint; 
  214.        Y     : out Gint); 
  215.    --  Obtains the coordinates where the label will draw the 
  216.    --  Pango.Layout.Pango_Layout representing the text in the label; useful to 
  217.    --  convert mouse events into coordinates inside the 
  218.    --  Pango.Layout.Pango_Layout, e.g. to take some action if some part of the 
  219.    --  label is clicked. Of course you will need to create a 
  220.    --  Gtk.Event_Box.Gtk_Event_Box to receive the events, and pack the label 
  221.    --  inside it, since labels are a GTK_NO_WINDOW widget. Remember when using 
  222.    --  the Pango.Layout.Pango_Layout functions you need to convert to and from 
  223.    --  pixels using PANGO_PIXELS or PANGO_SCALE. 
  224.    --  "x": location to store X offset of layout, or null 
  225.    --  "y": location to store Y offset of layout, or null 
  226.  
  227.    function Get_Line_Wrap (Label : access Gtk_Label_Record) return Boolean; 
  228.    procedure Set_Line_Wrap (Label : access Gtk_Label_Record; Wrap : Boolean); 
  229.    --  Toggles line wrapping within the Gtk.Label.Gtk_Label widget. True makes 
  230.    --  it break lines if text exceeds the widget's size. False lets the text 
  231.    --  get cut off by the edge of the widget if it exceeds the widget size. 
  232.    --  Note that setting line wrapping to True does not make the label wrap at 
  233.    --  its parent container's width, because GTK+ widgets conceptually can't 
  234.    --  make their requisition depend on the parent container's size. For a 
  235.    --  label that wraps at a specific position, set the label's width using 
  236.    --  Gtk.Widget.Set_Size_Request. 
  237.    --  "wrap": the setting 
  238.  
  239.    function Get_Line_Wrap_Mode 
  240.       (Label : access Gtk_Label_Record) return Pango.Layout.Pango_Wrap_Mode; 
  241.    procedure Set_Line_Wrap_Mode 
  242.       (Label     : access Gtk_Label_Record; 
  243.        Wrap_Mode : Pango.Layout.Pango_Wrap_Mode); 
  244.    --  If line wrapping is on (see Gtk.Label.Set_Line_Wrap) this controls how 
  245.    --  the line wrapping is done. The default is %PANGO_WRAP_WORD which means 
  246.    --  wrap on word boundaries. 
  247.    --  Since: gtk+ 2.10 
  248.    --  "wrap_mode": the line wrapping mode 
  249.  
  250.    function Get_Max_Width_Chars 
  251.       (Label : access Gtk_Label_Record) return Gint; 
  252.    procedure Set_Max_Width_Chars 
  253.       (Label   : access Gtk_Label_Record; 
  254.        N_Chars : Gint); 
  255.    --  Sets the desired maximum width in characters of Label to N_Chars. 
  256.    --  Since: gtk+ 2.6 
  257.    --  "n_chars": the new desired maximum width, in characters. 
  258.  
  259.    function Get_Mnemonic_Keyval 
  260.       (Label : access Gtk_Label_Record) return Guint; 
  261.    --  If the label has been set so that it has an mnemonic key this function 
  262.    --  returns the keyval used for the mnemonic accelerator. If there is no 
  263.    --  mnemonic set up it returns GDK_VoidSymbol. 
  264.  
  265.    function Get_Mnemonic_Widget 
  266.       (Label : access Gtk_Label_Record) return Gtk.Widget.Gtk_Widget; 
  267.    procedure Set_Mnemonic_Widget 
  268.       (Label  : access Gtk_Label_Record; 
  269.        Widget : access Gtk.Widget.Gtk_Widget_Record'Class); 
  270.    --  If the label has been set so that it has an mnemonic key (using i.e. 
  271.    --  Gtk.Label.Set_Markup_With_Mnemonic, Gtk.Label.Set_Text_With_Mnemonic, 
  272.    --  Gtk.Label.Gtk_New_With_Mnemonic or the "use_underline" property) the 
  273.    --  label can be associated with a widget that is the target of the 
  274.    --  mnemonic. When the label is inside a widget (like a 
  275.    --  Gtk.Button.Gtk_Button or a Gtk.Notebook.Gtk_Notebook tab) it is 
  276.    --  automatically associated with the correct widget, but sometimes (i.e. 
  277.    --  when the target is a Gtk.GEntry.Gtk_Entry next to the label) you need to 
  278.    --  set it explicitly using this function. The target widget will be 
  279.    --  accelerated by emitting the GtkWidget::mnemonic-activate signal on it. 
  280.    --  The default handler for this signal will activate the widget if there 
  281.    --  are no mnemonic collisions and toggle focus between the colliding 
  282.    --  widgets otherwise. 
  283.    --  "widget": the target Gtk.Widget.Gtk_Widget 
  284.  
  285.    function Get_Selectable (Label : access Gtk_Label_Record) return Boolean; 
  286.    procedure Set_Selectable 
  287.       (Label   : access Gtk_Label_Record; 
  288.        Setting : Boolean); 
  289.    --  Selectable labels allow the user to select text from the label, for 
  290.    --  copy-and-paste. 
  291.    --  "setting": True to allow selecting text in the label 
  292.  
  293.    procedure Get_Selection_Bounds 
  294.       (Label         : access Gtk_Label_Record; 
  295.        Start         : out Gint; 
  296.        The_End       : out Gint; 
  297.        Has_Selection : out Boolean); 
  298.    --  Gets the selected range of characters in the label, returning True if 
  299.    --  there's a selection. 
  300.    --  "start": return location for start of selection, as a character offset 
  301.    --  "end": return location for end of selection, as a character offset 
  302.  
  303.    function Get_Single_Line_Mode 
  304.       (Label : access Gtk_Label_Record) return Boolean; 
  305.    procedure Set_Single_Line_Mode 
  306.       (Label            : access Gtk_Label_Record; 
  307.        Single_Line_Mode : Boolean); 
  308.    --  Sets whether the label is in single line mode. 
  309.    --  Since: gtk+ 2.6 
  310.    --  "single_line_mode": True if the label should be in single line mode 
  311.  
  312.    function Get_Text (Label : access Gtk_Label_Record) return UTF8_String; 
  313.    procedure Set_Text (Label : access Gtk_Label_Record; Str : UTF8_String); 
  314.    --  Sets the text within the Gtk.Label.Gtk_Label widget. It overwrites any 
  315.    --  text that was there before. This will also clear any previously set 
  316.    --  mnemonic accelerators. 
  317.    --  "str": The text you want to set 
  318.  
  319.    function Get_Track_Visited_Links 
  320.       (Label : access Gtk_Label_Record) return Boolean; 
  321.    procedure Set_Track_Visited_Links 
  322.       (Label       : access Gtk_Label_Record; 
  323.        Track_Links : Boolean); 
  324.    --  Sets whether the label should keep track of clicked links (and use a 
  325.    --  different color for them). 
  326.    --  Since: gtk+ 2.18 
  327.    --  "track_links": True to track visited links 
  328.  
  329.    function Get_Use_Markup (Label : access Gtk_Label_Record) return Boolean; 
  330.    procedure Set_Use_Markup 
  331.       (Label   : access Gtk_Label_Record; 
  332.        Setting : Boolean); 
  333.    --  Sets whether the text of the label contains markup in <link 
  334.    --  linkend="PangoMarkupFormat">Pango's text markup language</link>. See 
  335.    --  Gtk.Label.Set_Markup. 
  336.    --  "setting": True if the label's text should be parsed for markup. 
  337.  
  338.    function Get_Use_Underline 
  339.       (Label : access Gtk_Label_Record) return Boolean; 
  340.    procedure Set_Use_Underline 
  341.       (Label   : access Gtk_Label_Record; 
  342.        Setting : Boolean); 
  343.    --  If true, an underline in the text indicates the next character should 
  344.    --  be used for the mnemonic accelerator key. 
  345.    --  "setting": True if underlines in the text indicate mnemonics 
  346.  
  347.    function Get_Width_Chars (Label : access Gtk_Label_Record) return Gint; 
  348.    procedure Set_Width_Chars 
  349.       (Label   : access Gtk_Label_Record; 
  350.        N_Chars : Gint); 
  351.    --  Sets the desired width in characters of Label to N_Chars. 
  352.    --  Since: gtk+ 2.6 
  353.    --  "n_chars": the new desired width, in characters. 
  354.  
  355.    function Parse_Uline 
  356.       (Label  : access Gtk_Label_Record; 
  357.        String : UTF8_String) return Guint; 
  358.  
  359.    procedure Select_Region 
  360.       (Label        : access Gtk_Label_Record; 
  361.        Start_Offset : Gint := -1; 
  362.        End_Offset   : Gint := -1); 
  363.    --  Selects a range of characters in the label, if the label is selectable. 
  364.    --  See Gtk.Label.Set_Selectable. If the label is not selectable, this 
  365.    --  function has no effect. If Start_Offset or 
  366.    --  "start_offset": start offset (in characters not bytes) 
  367.    --  "end_offset": end offset (in characters not bytes) 
  368.  
  369.    procedure Set_Markup (Label : access Gtk_Label_Record; Str : UTF8_String); 
  370.    --  Parses Str which is marked up with the <link 
  371.    --  linkend="PangoMarkupFormat">Pango text markup language</link>, setting 
  372.    --  the label's text and attribute list based on the parse results. If the 
  373.    --  Str is external data, you may need to escape it with 
  374.    --  g_markup_escape_text or g_markup_printf_escaped<!-- -->: |[ char 
  375.    --  *markup; markup = g_markup_printf_escaped ("&lt;span 
  376.    --  style=\"italic\"&gt;&percnt;s&lt;/span&gt;", str); gtk_label_set_markup 
  377.    --  (GTK_LABEL (label), markup); g_free (markup); ]| 
  378.    --  "str": a markup string (see <link linkend="PangoMarkupFormat">Pango 
  379.    --  markup format</link>) 
  380.  
  381.    procedure Set_Markup_With_Mnemonic 
  382.       (Label : access Gtk_Label_Record; 
  383.        Str   : UTF8_String); 
  384.    --  Parses Str which is marked up with the <link 
  385.    --  linkend="PangoMarkupFormat">Pango text markup language</link>, setting 
  386.    --  the label's text and attribute list based on the parse results. If 
  387.    --  characters in Str are preceded by an underscore, they are underlined 
  388.    --  indicating that they represent a keyboard accelerator called a mnemonic. 
  389.    --  The mnemonic key can be used to activate another widget, chosen 
  390.    --  automatically, or explicitly using Gtk.Label.Set_Mnemonic_Widget. 
  391.    --  "str": a markup string (see <link linkend="PangoMarkupFormat">Pango 
  392.    --  markup format</link>) 
  393.  
  394.    procedure Set_Pattern 
  395.       (Label   : access Gtk_Label_Record; 
  396.        Pattern : UTF8_String); 
  397.    --  Change the underlines pattern. 
  398.    --  Pattern is a simple string made of underscore and space characters, 
  399.    --  matching the ones in the string. GtkAda will underline every letter that 
  400.    --  matches an underscore. 
  401.    --  An empty string disables the underlines. 
  402.    --  example: If the text is FooBarBaz and the Pattern is "___ ___" then 
  403.    --  both "Foo" and "Baz" will be underlined, but not "Bar". 
  404.  
  405.    procedure Set_Text_With_Mnemonic 
  406.       (Label : access Gtk_Label_Record; 
  407.        Str   : UTF8_String); 
  408.    --  Sets the label's text from the string Str. If characters in Str are 
  409.    --  preceded by an underscore, they are underlined indicating that they 
  410.    --  represent a keyboard accelerator called a mnemonic. The mnemonic key can 
  411.    --  be used to activate another widget, chosen automatically, or explicitly 
  412.    --  using Gtk.Label.Set_Mnemonic_Widget. 
  413.    --  "str": a string 
  414.  
  415.    ---------------- 
  416.    -- Interfaces -- 
  417.    ---------------- 
  418.    --  This class implements several interfaces. See Glib.Types 
  419.    -- 
  420.    --  - "Buildable" 
  421.  
  422.    package Implements_Buildable is new Glib.Types.Implements 
  423.      (Gtk.Buildable.Gtk_Buildable, Gtk_Label_Record, Gtk_Label); 
  424.    function "+" 
  425.      (Widget : access Gtk_Label_Record'Class) 
  426.    return Gtk.Buildable.Gtk_Buildable 
  427.    renames Implements_Buildable.To_Interface; 
  428.    function "-" 
  429.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  430.    return Gtk_Label 
  431.    renames Implements_Buildable.To_Object; 
  432.  
  433.    ---------------- 
  434.    -- Properties -- 
  435.    ---------------- 
  436.    --  The following properties are defined for this widget. See 
  437.    --  Glib.Properties for more information on properties) 
  438.    -- 
  439.    --  Name: Angle_Property 
  440.    --  Type: Gdouble 
  441.    --  Flags: read-write 
  442.    --  The angle that the baseline of the label makes with the horizontal, in 
  443.    --  degrees, measured counterclockwise. An angle of 90 reads from from 
  444.    --  bottom to top, an angle of 270, from top to bottom. Ignored if the label 
  445.    --  is selectable, wrapped, or ellipsized. 
  446.    -- 
  447.    --  Name: Cursor_Position_Property 
  448.    --  Type: Gint 
  449.    --  Flags: read-write 
  450.    -- 
  451.    --  Name: Justify_Property 
  452.    --  Type: Gtk.Enums.Gtk_Justification 
  453.    --  Flags: read-write 
  454.    -- 
  455.    --  Name: Label_Property 
  456.    --  Type: UTF8_String 
  457.    --  Flags: read-write 
  458.    -- 
  459.    --  Name: Max_Width_Chars_Property 
  460.    --  Type: Gint 
  461.    --  Flags: read-write 
  462.    --  The desired maximum width of the label, in characters. If this property 
  463.    --  is set to -1, the width will be calculated automatically, otherwise the 
  464.    --  label will request space for no more than the requested number of 
  465.    --  characters. If the Gtk.Label.Gtk_Label:width-chars property is set to a 
  466.    --  positive value, then the "max-width-chars" property is ignored. 
  467.    -- 
  468.    --  Name: Mnemonic_Keyval_Property 
  469.    --  Type: Guint 
  470.    --  Flags: read-write 
  471.    -- 
  472.    --  Name: Mnemonic_Widget_Property 
  473.    --  Type: Gtk.Widget.Gtk_Widget 
  474.    --  Flags: read-write 
  475.    -- 
  476.    --  Name: Pattern_Property 
  477.    --  Type: UTF8_String 
  478.    --  Flags: write 
  479.    -- 
  480.    --  Name: Selectable_Property 
  481.    --  Type: Boolean 
  482.    --  Flags: read-write 
  483.    -- 
  484.    --  Name: Selection_Bound_Property 
  485.    --  Type: Gint 
  486.    --  Flags: read-write 
  487.    -- 
  488.    --  Name: Single_Line_Mode_Property 
  489.    --  Type: Boolean 
  490.    --  Flags: read-write 
  491.    --  Whether the label is in single line mode. In single line mode, the 
  492.    --  height of the label does not depend on the actual text, it is always set 
  493.    --  to ascent + descent of the font. This can be an advantage in situations 
  494.    --  where resizing the label because of text changes would be distracting, 
  495.    --  e.g. in a statusbar. 
  496.    -- 
  497.    --  Name: Track_Visited_Links_Property 
  498.    --  Type: Boolean 
  499.    --  Flags: read-write 
  500.    --  Set this property to True to make the label track which links have been 
  501.    --  clicked. It will then apply the ::visited-link-color color, instead of 
  502.    --  ::link-color. 
  503.    -- 
  504.    --  Name: Use_Markup_Property 
  505.    --  Type: Boolean 
  506.    --  Flags: read-write 
  507.    -- 
  508.    --  Name: Use_Underline_Property 
  509.    --  Type: Boolean 
  510.    --  Flags: read-write 
  511.    -- 
  512.    --  Name: Width_Chars_Property 
  513.    --  Type: Gint 
  514.    --  Flags: read-write 
  515.    --  The desired width of the label, in characters. If this property is set 
  516.    --  to -1, the width will be calculated automatically, otherwise the label 
  517.    --  will request either 3 characters or the property value, whichever is 
  518.    --  greater. If the "width-chars" property is set to a positive value, then 
  519.    --  the Gtk.Label.Gtk_Label:max-width-chars property is ignored. 
  520.    -- 
  521.    --  Name: Wrap_Property 
  522.    --  Type: Boolean 
  523.    --  Flags: read-write 
  524.  
  525.    Angle_Property : constant Glib.Properties.Property_Double; 
  526.    Cursor_Position_Property : constant Glib.Properties.Property_Int; 
  527.    Justify_Property : constant Gtk.Enums.Property_Gtk_Justification; 
  528.    Label_Property : constant Glib.Properties.Property_String; 
  529.    Max_Width_Chars_Property : constant Glib.Properties.Property_Int; 
  530.    Mnemonic_Keyval_Property : constant Glib.Properties.Property_Uint; 
  531.    Mnemonic_Widget_Property : constant Glib.Properties.Property_Object; 
  532.    Pattern_Property : constant Glib.Properties.Property_String; 
  533.    Selectable_Property : constant Glib.Properties.Property_Boolean; 
  534.    Selection_Bound_Property : constant Glib.Properties.Property_Int; 
  535.    Single_Line_Mode_Property : constant Glib.Properties.Property_Boolean; 
  536.    Track_Visited_Links_Property : constant Glib.Properties.Property_Boolean; 
  537.    Use_Markup_Property : constant Glib.Properties.Property_Boolean; 
  538.    Use_Underline_Property : constant Glib.Properties.Property_Boolean; 
  539.    Width_Chars_Property : constant Glib.Properties.Property_Int; 
  540.    Wrap_Property : constant Glib.Properties.Property_Boolean; 
  541.  
  542.    ------------- 
  543.    -- Signals -- 
  544.    ------------- 
  545.    --  The following new signals are defined for this widget: 
  546.    -- 
  547.    --  "activate-current-link" 
  548.    --     procedure Handler (Self : access Gtk_Label_Record'Class); 
  549.    --  A <link linkend="keybinding-signals">keybinding signal</link> which 
  550.    --  gets emitted when the user activates a link in the label. Applications 
  551.    --  may also emit the signal with g_signal_emit_by_name if they need to 
  552.    --  control activation of URIs programmatically. The default bindings for 
  553.    --  this signal are all forms of the Enter key. 
  554.    -- 
  555.    --  "activate-link" 
  556.    --     function Handler 
  557.    --       (Self : access Gtk_Label_Record'Class; 
  558.    --        Uri  : UTF8_String) return Boolean; 
  559.    --    --  "uri": the URI that is activated 
  560.    --  The signal which gets emitted to activate a URI. Applications may 
  561.    --  connect to it to override the default behaviour, which is to call 
  562.    --  gtk_show_uri(). 
  563.    --  Returns True if the link has been activated 
  564.    -- 
  565.    --  "copy-clipboard" 
  566.    --     procedure Handler (Self : access Gtk_Label_Record'Class); 
  567.    --  The ::copy-clipboard signal is a <link 
  568.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  569.    --  to copy the selection to the clipboard. The default binding for this 
  570.    --  signal is Ctrl-c. 
  571.    -- 
  572.    --  "move-cursor" 
  573.    --     procedure Handler 
  574.    --       (Self             : access Gtk_Label_Record'Class; 
  575.    --        Step             : MovementStep; 
  576.    --        Count            : Gint; 
  577.    --        Extend_Selection : Boolean); 
  578.    --    --  "step": the granularity of the move, as a GtkMovementStep 
  579.    --    --  "count": the number of Step units to move 
  580.    --    --  "extend_selection": True if the move should extend the selection 
  581.    --  The ::move-cursor signal is a <link 
  582.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  583.    --  when the user initiates a cursor movement. If the cursor is not visible 
  584.    --  in Entry, this signal causes the viewport to be moved instead. 
  585.    --  Applications should not connect to it, but may emit it with 
  586.    --  g_signal_emit_by_name if they need to control the cursor 
  587.    --  programmatically. The default bindings for this signal come in two 
  588.    --  variants, the variant with the Shift modifier extends the selection, the 
  589.    --  variant without the Shift modifer does not. There are too many key 
  590.    --  combinations to list them all here. <itemizedlist> <listitem>Arrow keys 
  591.    --  move by individual characters/lines</listitem> <listitem>Ctrl-arrow key 
  592.    --  combinations move by words/paragraphs</listitem> <listitem>Home/End keys 
  593.    --  move to the ends of the buffer</listitem> </itemizedlist> 
  594.    -- 
  595.    --  "populate-popup" 
  596.    --     procedure Handler 
  597.    --       (Self : access Gtk_Label_Record'Class; 
  598.    --        Menu : Gtk.Menu.Gtk_Menu); 
  599.    --    --  "menu": the menu that is being populated 
  600.    --  The ::populate-popup signal gets emitted before showing the context 
  601.    --  menu of the label. Note that only selectable labels have context menus. 
  602.    --  If you need to add items to the context menu, connect to this signal and 
  603.    --  append your menuitems to the Menu. 
  604.  
  605.    Signal_Activate_Current_Link : constant Glib.Signal_Name := "activate-current-link"; 
  606.    Signal_Activate_Link : constant Glib.Signal_Name := "activate-link"; 
  607.    Signal_Copy_Clipboard : constant Glib.Signal_Name := "copy-clipboard"; 
  608.    Signal_Move_Cursor : constant Glib.Signal_Name := "move-cursor"; 
  609.    Signal_Populate_Popup : constant Glib.Signal_Name := "populate-popup"; 
  610.  
  611. private 
  612.    Angle_Property : constant Glib.Properties.Property_Double := 
  613.      Glib.Properties.Build ("angle"); 
  614.    Cursor_Position_Property : constant Glib.Properties.Property_Int := 
  615.      Glib.Properties.Build ("cursor-position"); 
  616.    Justify_Property : constant Gtk.Enums.Property_Gtk_Justification := 
  617.      Gtk.Enums.Build ("justify"); 
  618.    Label_Property : constant Glib.Properties.Property_String := 
  619.      Glib.Properties.Build ("label"); 
  620.    Max_Width_Chars_Property : constant Glib.Properties.Property_Int := 
  621.      Glib.Properties.Build ("max-width-chars"); 
  622.    Mnemonic_Keyval_Property : constant Glib.Properties.Property_Uint := 
  623.      Glib.Properties.Build ("mnemonic-keyval"); 
  624.    Mnemonic_Widget_Property : constant Glib.Properties.Property_Object := 
  625.      Glib.Properties.Build ("mnemonic-widget"); 
  626.    Pattern_Property : constant Glib.Properties.Property_String := 
  627.      Glib.Properties.Build ("pattern"); 
  628.    Selectable_Property : constant Glib.Properties.Property_Boolean := 
  629.      Glib.Properties.Build ("selectable"); 
  630.    Selection_Bound_Property : constant Glib.Properties.Property_Int := 
  631.      Glib.Properties.Build ("selection-bound"); 
  632.    Single_Line_Mode_Property : constant Glib.Properties.Property_Boolean := 
  633.      Glib.Properties.Build ("single-line-mode"); 
  634.    Track_Visited_Links_Property : constant Glib.Properties.Property_Boolean := 
  635.      Glib.Properties.Build ("track-visited-links"); 
  636.    Use_Markup_Property : constant Glib.Properties.Property_Boolean := 
  637.      Glib.Properties.Build ("use-markup"); 
  638.    Use_Underline_Property : constant Glib.Properties.Property_Boolean := 
  639.      Glib.Properties.Build ("use-underline"); 
  640.    Width_Chars_Property : constant Glib.Properties.Property_Int := 
  641.      Glib.Properties.Build ("width-chars"); 
  642.    Wrap_Property : constant Glib.Properties.Property_Boolean := 
  643.      Glib.Properties.Build ("wrap"); 
  644. end Gtk.Label;