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-2010, 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 
  32. --  to display on the screen. You can change the text dynamically if 
  33. --  needed. 
  34. -- 
  35. --  The text can be on multiple lines if you separate each line with 
  36. --  the ASCII.LF character. However, this is not the recommended way 
  37. --  to display long texts (see the Gtk_Text widget instead). 
  38. -- 
  39. --  Mnemonics 
  40. --  ========= 
  41. --  Labels may contain mnemonics. Mnemonics are underlined characters in the 
  42. --  label, used for keyboard navigation. Mnemonics are created by providing 
  43. --  string with an underscore before the mnemonic character, such as "_File", 
  44. --  to the functions gtk_new_with_mnemonic or set_text_with_mnemonic(). 
  45. -- 
  46. --  Mnemonics automatically activate any activatable widget the label is 
  47. --  inside, such as a Gtk_Button; if the label is not inside the mnemonic's 
  48. --  target widget, you have to tell the label about the target using 
  49. --  set_mnemonic_widget(). For instance: 
  50. --      declare 
  51. --         Button : Gtk_Button; 
  52. --         Label  : Gtk_Label; 
  53. --      begin 
  54. --         Gtk_New (Button); 
  55. --         Gtk_New_With_Mnemonic (Label, "_File"); 
  56. --         Add (Button, Label); 
  57. --      end; 
  58. --  However, there exists a convenience function in Gtk.Button to create such 
  59. --  a button already. 
  60. -- 
  61. --  Markup 
  62. --  ====== 
  63. --  To make it easy to format text in a label (changing colors, fonts, etc.), 
  64. --  label text can be provided in a simple markup format. Here's how to create 
  65. --  a label with a small font: 
  66. --       Gtk_New (Label, "<small>hello</small>"); 
  67. -- 
  68. --  The markup must be valid, and <>& characters must be escaped with 
  69. --  &lt; &gt; and &amp; 
  70. -- 
  71. --  Markup strings are just a convenient way to set the Pango_Attr_List on 
  72. --  label; Set_Attributes() may be a simpler way to set attributes in some 
  73. --  cases. Be careful though; Pango_Attr_List tends to cause 
  74. --  internationalization problems, unless you're applying attributes to the 
  75. --  entire string (i.e. unless you set the range of each attribute to [0, 
  76. --  G_MAXINT)). The reason is that specifying the start_index and end_index for 
  77. --  a Pango_Attribute requires knowledge of the exact string being displayed, 
  78. --  so translations will cause problems. 
  79. -- 
  80. --  Selectable labels 
  81. --  ================= 
  82. --  Labels can be made selectable with Set_Selectable. Selectable 
  83. --  labels allow the user to copy the label contents to the clipboard. Only 
  84.  
  85. --  should be made selectable. 
  86. --  </description> 
  87. --  <c_version>2.8.17</c_version> 
  88. --  <group>Display widgets</group> 
  89. --  <testgtk>create_label.adb</testgtk> 
  90. --  <screenshot>gtk-label</screenshot> 
  91.  
  92. with Gdk.Types; 
  93. with Glib.Properties; 
  94. with Gtk.Enums; 
  95. with Gtk.Misc; 
  96. with Gtk.Widget; 
  97. with Pango.Attributes; 
  98. with Pango.Layout; 
  99.  
  100. package Gtk.Label is 
  101.  
  102.    type Gtk_Label_Record is new Misc.Gtk_Misc_Record with private; 
  103.    type Gtk_Label is access all Gtk_Label_Record'Class; 
  104.  
  105.    procedure Gtk_New (Label : out Gtk_Label; Str : UTF8_String := ""); 
  106.    procedure Initialize 
  107.      (Label : access Gtk_Label_Record'Class; Str : UTF8_String); 
  108.    --  Creates or initializes a new label. 
  109.    --  Str is the string to be displayed. 
  110.  
  111.    procedure Gtk_New_With_Mnemonic (Label : out Gtk_Label; Str : UTF8_String); 
  112.    procedure Initialize_With_Mnemonic 
  113.      (Label : access Gtk_Label_Record'Class; Str : UTF8_String); 
  114.    --  Creates or initializes a new label containing the text in Str. 
  115.    --  If characters in Str are preceded by an underscore, they are underlined 
  116.    --  indicating that they represent a keyboard accelerator called a mnemonic. 
  117.    --  The mnemonic key can be used to activate another widget, chosen 
  118.    --  automatically or explicitely using Set_Mnemonic_Widget. 
  119.  
  120.    function Get_Type return Glib.GType; 
  121.    --  Return the internal value associated with a Gtk_Label. 
  122.  
  123.    procedure Set_Justify 
  124.      (Label : access Gtk_Label_Record; 
  125.       Jtype : Enums.Gtk_Justification); 
  126.    function Get_Justify 
  127.      (Label : access Gtk_Label_Record) return Enums.Gtk_Justification; 
  128.    --  Set the justification for the label. 
  129.    --  The default value is Justify_Center, which means that the text will be 
  130.    --  centered in the label. Note that this setting has an impact only when 
  131.    --  the Gtk_Label is larger than the text (its default width is the same 
  132.    --  as the text) and contains multiple lines. 
  133.    --  To justify a single line label, you should instead call Set_Alignment 
  134.    --  and make sure that the label or any surrounding container fills its 
  135.    --  horizontal allocated space. 
  136.  
  137.    procedure Set_Line_Wrap (Label : access Gtk_Label_Record; Wrap : Boolean); 
  138.    function  Get_Line_Wrap (Label : access Gtk_Label_Record) return Boolean; 
  139.    --  Toggle line wrapping within Label. 
  140.    --  if Wrap is True, then Label will break lines if the text is larger 
  141.    --  then the widget's size. If Wrap is False, then the text is simply 
  142.    --  cut off. 
  143.  
  144.    procedure Set_Line_Wrap_Mode 
  145.      (Label     : access Gtk_Label_Record; 
  146.       Wrap_Mode : Pango.Layout.Pango_Wrap_Mode); 
  147.    function Get_Line_Wrap_Mode 
  148.      (Label : access Gtk_Label_Record) return Pango.Layout.Pango_Wrap_Mode; 
  149.    --  If line wrapping is on (see Set_Line_Wrap) this controls how the 
  150.    --  line wrapping is done. The default is Pango_Wrap_Word which means 
  151.    --  wrap on word boundaries. 
  152.  
  153.    procedure Set_Selectable 
  154.      (Label : access Gtk_Label_Record; Selectable : Boolean); 
  155.    function  Get_Selectable (Label : access Gtk_Label_Record) return Boolean; 
  156.    --  Selectable labels allow the user to select text from the label, 
  157.    --  for copy-and-paste. 
  158.  
  159.    procedure Set_Use_Markup 
  160.      (Label : access Gtk_Label_Record; Markup : Boolean); 
  161.    function Get_Use_Markup (Label : access Gtk_Label_Record) return Boolean; 
  162.    --  Sets whether the text of the label contains markup in Pango's 
  163.    --  text markup language.  If Markup is True, then Label will be 
  164.    --  parsed for markup. 
  165.  
  166.    procedure Set_Use_Underline 
  167.      (Label : access Gtk_Label_Record; Underline : Boolean); 
  168.    function Get_Use_Underline (Label : access Gtk_Label_Record) return Boolean; 
  169.    --  Indicates wether an embedded underline in the label indicates the 
  170.    --  mnemonic accelerator key. 
  171.  
  172.    procedure Set_Angle (Label : access Gtk_Label_Record;  Angle : Gdouble); 
  173.    function Get_Angle  (Label : access Gtk_Label_Record) return Gdouble; 
  174.    --  Sets the angle of rotation for the label. An angle of 90 reads from 
  175.    --  from bottom to top, an angle of 270, from top to bottom. The angle 
  176.    --  setting for the label is ignored if the label is selectable, 
  177.    --  wrapped, or ellipsized. 
  178.  
  179.    procedure Set_Ellipsize 
  180.      (Label : access Gtk_Label_Record; 
  181.       Mode  : Pango.Layout.Pango_Ellipsize_Mode); 
  182.    function Get_Ellipsize 
  183.      (Label : access Gtk_Label_Record) 
  184.       return Pango.Layout.Pango_Ellipsize_Mode; 
  185.    --  Sets the mode used to ellipsize (add an ellipsis: "...") to the text if 
  186.    --  there is not enough space to render the entire string. 
  187.  
  188.    procedure Set_Text (Label : access Gtk_Label_Record; Str : UTF8_String); 
  189.    function  Get_Text (Label : access Gtk_Label_Record) return UTF8_String; 
  190.    --  Change the text of the label. 
  191.    --  The new text is visible on the screen at once. Note that the underline 
  192.    --  pattern is not modified. 
  193.  
  194.    procedure Set_Label (Label : access Gtk_Label_Record; Str : String); 
  195.    function Get_Label  (Label : access Gtk_Label_Record) return String; 
  196.    --  Sets the text of the label. The label is interpreted as 
  197.    --  including embedded underlines and/or Pango markup depending 
  198.    --  on the values of label->use_underline and label->use_markup. 
  199.  
  200.    function Get_Layout 
  201.      (Label : access Gtk_Label_Record) return Pango.Layout.Pango_Layout; 
  202.    --  Gets the layout used to display the label. 
  203.    --  The layout is useful to e.g. convert text positions to pixel positions, 
  204.    --  in combination with Get_Layout_Offsets(). The returned layout is owned 
  205.    --  by the label so need not be freed by the caller. 
  206.  
  207.    procedure Get_Layout_Offsets 
  208.      (Label : access Gtk_Label_Record; 
  209.       X, Y  : out Gint); 
  210.    --  Obtains the coordinates where the label will draw the layout 
  211.    --  representing the text in the label; useful to convert mouse events into 
  212.    --  coordinates inside the layout, e.g. to take some action if some part of 
  213.    --  the label is clicked. Of course you will need to create a Gtk_Event_Box 
  214.    --  to receive the events, and pack the label inside it, since labels are a 
  215.    --  #GTK_NO_WINDOW widget. Remember when using the layout functions you need 
  216.    --  to convert to and from pixels using PANGO_PIXELS() or #PANGO_SCALE. 
  217.  
  218.    procedure Set_Max_Width_Chars 
  219.      (Label : access Gtk_Label_Record; N_Chars : Gint); 
  220.    function Get_Max_Width_Chars (Label : access Gtk_Label_Record) return Gint; 
  221.    --  Sets the desired maximum width in characters of Label 
  222.  
  223.    procedure Set_Width_Chars (Label : access Gtk_Label_Record; N_Chars : Gint); 
  224.    function Get_Width_Chars  (Label : access Gtk_Label_Record) return Gint; 
  225.    --  Sets the desired width in characters of Label. 
  226.  
  227.    procedure Set_Single_Line_Mode 
  228.      (Label            : access Gtk_Label_Record; 
  229.       Single_Line_Mode : Boolean); 
  230.    function Get_Single_Line_Mode 
  231.      (Label : access Gtk_Label_Record) return Boolean; 
  232.    --  Sets whether the label is in single line mode. 
  233.  
  234.    function Get_Mnemonic_Keyval 
  235.      (Label : access Gtk_Label_Record) return Gdk.Types.Gdk_Key_Type; 
  236.    --  Return the key value of the mnemonic accelerator key indicated by an 
  237.    --  embedded underline in the label. If there is no mnemonic set up it 
  238.    --  returns Gdk.Types.Keysyms.GDK_VoidSymbol. 
  239.  
  240.    procedure Set_Attributes 
  241.      (Label : access Gtk_Label_Record; 
  242.       Attrs : Pango.Attributes.Pango_Attr_List); 
  243.    function Get_Attributes 
  244.      (Label : access Gtk_Label_Record) return Pango.Attributes.Pango_Attr_List; 
  245.    --  Sets a list of attributes to be applied to the label text. These 
  246.    --  attributes will be ignored if the use_underline or use_markup 
  247.    --  properties are set. 
  248.    --  Get_Attributes does not reflect attributes that come from the label's 
  249.    --  markup (see Set_Markup). If you want to get the effective attributes for 
  250.    --  the label, use Pango.Layout.Get_Attribute (Get_Layout (Label)). 
  251.  
  252.    procedure Set_Text_With_Mnemonic 
  253.      (Label : access Gtk_Label_Record; 
  254.       Str   : UTF8_String); 
  255.    --  Change the text and mnemonic key of the label. 
  256.    --  The new text and mnemonic are visible on the screen at once. 
  257.    --  The mnemonic key can be used to activate another widget, chosen 
  258.    --  automatically or explicitely using Set_Mnemonic_Widget. 
  259.  
  260.    procedure Set_Markup (Label : access Gtk_Label_Record; Str : UTF8_String); 
  261.    --  Parses Str which is marked up with the Pango text markup language, 
  262.    --  setting the label's text and attribute list based on the parse results. 
  263.  
  264.    procedure Set_Markup_With_Mnemonic 
  265.      (Label : access Gtk_Label_Record; 
  266.       Str   : UTF8_String); 
  267.    --  Parse Str which is marked up with the Pango text markup language, 
  268.    --  setting the label's text and attribute list based on the parse results. 
  269.    --  If characters in Str are preceded by an underscore, they are underlined 
  270.    --  indicating that they represent a mnemonic. 
  271.    --  The mnemonic key can be used to activate another widget, chosen 
  272.    --  automatically or explicitely using Set_Mnemonic_Widget. 
  273.  
  274.    procedure Set_Mnemonic_Widget 
  275.      (Label  : access Gtk_Label_Record; 
  276.       Widget : access Gtk.Widget.Gtk_Widget_Record'Class); 
  277.    function Get_Mnemonic_Widget 
  278.      (Label : access Gtk_Label_Record) return Gtk.Widget.Gtk_Widget; 
  279.    --  If the label has been set so that it has an mnemonic key, the label can 
  280.    --  be associated with a widget that is the target of the mnemonic. 
  281.    --  When the label is inside a widget (like a Gtk_Button or a Gtk_Notebook 
  282.    --  tab), it is automatically associated with the correct widget, but 
  283.    --  sometimes (i.e. when the target is a Gtk_Entry next to the label), 
  284.    --  you need to set it explicitly using this procedure. 
  285.    --  The target widget will be accelerated by emitting "mnemonic_activate" 
  286.    --  on it. The default handler for this signal will activate the widget if 
  287.    --  there are no mnemonic collisions and toggle focus between the colliding 
  288.    --  widgets otherwise. 
  289.  
  290.    procedure Select_Region 
  291.      (Label        : access Gtk_Label_Record; 
  292.       Start_Offset : Integer := -1; 
  293.       End_Offset   : Integer := -1); 
  294.    --  Selects a range of characters in the label, if the label is 
  295.    --  selectable.  If Start or End are -1, then the end of the label 
  296.    --  will be substituted. 
  297.  
  298.    procedure Get_Selection_Bounds 
  299.      (Label         : access Gtk_Label_Record; 
  300.       First, Last   : out Gint; 
  301.       Has_Selection : out Boolean); 
  302.    --  Gets the selected range of characters in the label, returning True 
  303.    --  if there's a selection. 
  304.  
  305.    procedure Set_Pattern 
  306.      (Label   : access Gtk_Label_Record; 
  307.       Pattern : String); 
  308.    --  Change the underlines pattern. 
  309.    --  Pattern is a simple string made of underscore and space characters, 
  310.    --  matching the ones in the string. GtkAda will underline every letter 
  311.    --  that matches an underscore. 
  312.    --  An empty string disables the underlines. 
  313.    --  example: If the text is FooBarBaz and the Pattern is "___   ___" 
  314.    --  then both "Foo" and "Baz" will be underlined, but not "Bar". 
  315.  
  316.    ----------------- 
  317.    -- Obsolescent -- 
  318.    ----------------- 
  319.    --  All subprograms below are now obsolescent in gtk+. They might be removed 
  320.    --  from future versions of gtk+ (and therefore GtkAda). 
  321.    --  To find out whether your code uses any of these, we recommend compiling 
  322.    --  with the -gnatwj switch 
  323.    --  <doc_ignore> 
  324.  
  325.    function Get 
  326.      (Label : access Gtk_Label_Record) return UTF8_String renames Get_Text; 
  327.    --  pragma Obsolescent; 
  328.    --  Same as Get_Text. 
  329.  
  330.    --  </doc_ignore> 
  331.  
  332.    ---------------- 
  333.    -- Properties -- 
  334.    ---------------- 
  335.  
  336.    --  <properties> 
  337.    --  The following properties are defined for this widget. See 
  338.    --  Glib.Properties for more information on properties. 
  339.    -- 
  340.    --  Name:  Label_Property 
  341.    --  Type:  UTF8_String 
  342.    --  Flags: read-write 
  343.    --  Descr: The text of the label. 
  344.    --  See also: Set_Text and Get_Text 
  345.    -- 
  346.    --  Name:  Attributes_Property 
  347.    --  Type:  Pango_Type_Attr_List 
  348.    --  Flags: read-write 
  349.    --  Descr: A list of style attributes to apply to the text of the label. 
  350.    --  See also: ??? Unsupported yet 
  351.    -- 
  352.    --  Name:  Use_Markup_Property 
  353.    --  Type:  Boolean 
  354.    --  Flags: read-write 
  355.    --  Descr: The text of the label includes XML markup. 
  356.    --         See pango_parse_markup(). 
  357.    --  See also: <none> 
  358.    -- 
  359.    --  Name:  Use_Underline_Property 
  360.    --  Type:  Boolean 
  361.    --  Flags: read-write 
  362.    --  Descr: If set, an underline in the text indicates the next character 
  363.    --         should be used for the mnemonic accelerator key 
  364.    --  See also: <none> 
  365.    -- 
  366.    --  Name:  Justify_Property 
  367.    --  Type:  Gtk_Justification 
  368.    --  Flags: read-write 
  369.    --  Descr: The alignment of the lines in the text of the label relative to 
  370.    --         each other. This does NOT affect the alignment of the label 
  371.    --         within its allocation. 
  372.    --  See also: Set_Justify 
  373.    -- 
  374.    --  Name:  Pattern_Property 
  375.    --  Type:  String 
  376.    --  Flags: read-write 
  377.    --  Descr: A string with _ characters in positions correspond to 
  378.    --         characters in the text to underline. 
  379.    --  See also: Set_Pattern 
  380.    -- 
  381.    --  Name:  Wrap_Property 
  382.    --  Type:  Boolean 
  383.    --  Flags: read-write 
  384.    --  Descr: If set, wrap lines if the text becomes too wide. 
  385.    --  See also: Set_Line_Wrap 
  386.    -- 
  387.    --  Name:  Wrap_Mode_Property 
  388.    --  Type:  Enum 
  389.    --  Descr: If wrap is set, controls how linewrapping is done 
  390.    -- 
  391.    --  Name:  Selectable_Property 
  392.    --  Type:  Boolean 
  393.    --  Flags: read-write 
  394.    --  Descr: Whether the label text can be selected with the mouse. 
  395.    --  See also: <none> 
  396.    -- 
  397.    --  Name:  Mnemonic_Keyval_Property 
  398.    --  Type:  Guint 
  399.    --  Flags: readable 
  400.    --  Descr: The mnemonic accelerator key for this label. 
  401.    --  See also: Gtk_New_With_Mnemonic 
  402.    -- 
  403.    --  Name:  Mnemonic_Widget_Property 
  404.    --  Type:  Gtk_Widget_Record'Class 
  405.    --  Flags: read-write 
  406.    --  Descr: The widget to be activated when the label's mnemonic key is 
  407.    --         pressed 
  408.    -- 
  409.    --  Name:  Angle_Property 
  410.    --  Type:  Double 
  411.    --  Descr: Angle at which the label is rotated 
  412.    -- 
  413.    --  Name:  Cursor_Position_Property 
  414.    --  Type:  Int 
  415.    --  Descr: The current position of the insertion cursor in chars 
  416.    -- 
  417.    --  Name:  Ellipsize_Property 
  418.    --  Type:  Enum 
  419.    --  Descr: The preferred place to ellipsize the string, if the label does 
  420.    --         not have enough room to display the entire string, if at all 
  421.    -- 
  422.    --  Name:  Max_Width_Chars_Property 
  423.    --  Type:  Int 
  424.    --  Descr: The desired maximum width of the label, in characters 
  425.    -- 
  426.    --  Name:  Selection_Bound_Property 
  427.    --  Type:  Int 
  428.    --  Descr: The position of the opposite end of the selection from the cursor 
  429.    --         in chars 
  430.    -- 
  431.    --  Name:  Single_Line_Mode_Property 
  432.    --  Type:  Boolean 
  433.    --  Descr: Whether the label is in single line mode 
  434.    -- 
  435.    --  Name:  Width_Chars_Property 
  436.    --  Type:  Int 
  437.    --  Descr: The desired width of the label, in characters 
  438.    -- 
  439.    --  </properties> 
  440.  
  441.    Label_Property            : constant Glib.Properties.Property_String; 
  442.    --  Attributes_Property   : constant ??? 
  443.    Use_Markup_Property       : constant Glib.Properties.Property_Boolean; 
  444.    Use_Underline_Property    : constant Glib.Properties.Property_Boolean; 
  445.    Justify_Property          : constant Gtk.Enums.Property_Gtk_Justification; 
  446.    Pattern_Property          :  constant Glib.Properties.Property_String; 
  447.    Wrap_Property             : constant Glib.Properties.Property_Boolean; 
  448.    Wrap_Mode_Property        : constant Glib.Properties.Property_Enum; 
  449.    Selectable_Property       : constant Glib.Properties.Property_Boolean; 
  450.    Mnemonic_Keyval_Property  : constant Glib.Properties.Property_Uint_RO; 
  451.    Mnemonic_Widget_Property  : constant Glib.Properties.Property_Object; 
  452.    Angle_Property            : constant Glib.Properties.Property_Double; 
  453.    Cursor_Position_Property  : constant Glib.Properties.Property_Int; 
  454.    --  Ellipsize_Property        : constant Glib.Properties.Property_Enum; 
  455.    Max_Width_Chars_Property  : constant Glib.Properties.Property_Int; 
  456.    Selection_Bound_Property  : constant Glib.Properties.Property_Int; 
  457.    Single_Line_Mode_Property : constant Glib.Properties.Property_Boolean; 
  458.    Width_Chars_Property      : constant Glib.Properties.Property_Int; 
  459.  
  460.    ------------- 
  461.    -- Signals -- 
  462.    ------------- 
  463.  
  464.    --  <signals> 
  465.    --  The following new signals are defined for this widget: 
  466.    -- 
  467.    --  - "copy_clipboard" 
  468.    --    procedure Handler (Label : access Gtk_Label_Record'Class); 
  469.    --    Request a copy the label's text into the clipboard. This should be 
  470.    --    bound to a key. 
  471.    -- 
  472.    --  - "move_cursor" 
  473.    --    procedure Handler 
  474.    --       (Label  : access Gtk_Label_Record'Class; 
  475.    --        Step   : Gtk_Movement_Step; 
  476.    --        Amount : Gint; 
  477.    --        Extend_Selection : Boolean); 
  478.    --    You should emit this signal to request that the cursor be moved inside 
  479.    --    the label. This is mostly useful from a keybinding. The cursor is 
  480.    --    also used as the insertion point when modifying the label 
  481.    -- 
  482.    --  - "populate_popup" 
  483.    --    procedure Handler 
  484.    --       (Label : access Gtk_Label_Record'Class; 
  485.    --        Menu  : access Gtk_Menu_Record'Class); 
  486.    --    ??? 
  487.    -- 
  488.    --  </signals> 
  489.  
  490.    Signal_Copy_Clipboard : constant Glib.Signal_Name := "copy_clipboard"; 
  491.    Signal_Move_Cursor    : constant Glib.Signal_Name := "move_cursor"; 
  492.    Signal_Populate_Popup : constant Glib.Signal_Name := "populate_popup"; 
  493.  
  494. private 
  495.    type Gtk_Label_Record is new Misc.Gtk_Misc_Record with null record; 
  496.  
  497.    Label_Property           : constant Glib.Properties.Property_String := 
  498.      Glib.Properties.Build ("label"); 
  499.    Use_Markup_Property      : constant Glib.Properties.Property_Boolean := 
  500.      Glib.Properties.Build ("use_markup"); 
  501.    Use_Underline_Property   : constant Glib.Properties.Property_Boolean := 
  502.      Glib.Properties.Build ("use_underline"); 
  503.    Justify_Property         : constant Gtk.Enums.Property_Gtk_Justification := 
  504.      Gtk.Enums.Build ("justify"); 
  505.    Pattern_Property         : constant Glib.Properties.Property_String := 
  506.      Glib.Properties.Build ("pattern"); 
  507.    Wrap_Property            : constant Glib.Properties.Property_Boolean := 
  508.      Glib.Properties.Build ("wrap"); 
  509.    Wrap_Mode_Property : constant Glib.Properties.Property_Enum := 
  510.      Glib.Properties.Build ("wrap-mode"); 
  511.    Selectable_Property      : constant Glib.Properties.Property_Boolean := 
  512.      Glib.Properties.Build ("selectable"); 
  513.    Mnemonic_Keyval_Property : constant Glib.Properties.Property_Uint_RO := 
  514.      Glib.Properties.Build ("mnemonic_keyval"); 
  515.    Mnemonic_Widget_Property : constant Glib.Properties.Property_Object := 
  516.      Glib.Properties.Build ("mnemonic_widget"); 
  517.    Angle_Property : constant Glib.Properties.Property_Double := 
  518.      Glib.Properties.Build ("angle"); 
  519.    Cursor_Position_Property : constant Glib.Properties.Property_Int := 
  520.      Glib.Properties.Build ("cursor-position"); 
  521.    --     Ellipsize_Property : constant Glib.Properties.Property_Enum := 
  522.    --       Glib.Properties.Build ("ellipsize"); 
  523.    Max_Width_Chars_Property : constant Glib.Properties.Property_Int := 
  524.      Glib.Properties.Build ("max-width-chars"); 
  525.    Selection_Bound_Property : constant Glib.Properties.Property_Int := 
  526.      Glib.Properties.Build ("selection-bound"); 
  527.    Single_Line_Mode_Property : constant Glib.Properties.Property_Boolean := 
  528.      Glib.Properties.Build ("single-line-mode"); 
  529.    Width_Chars_Property : constant Glib.Properties.Property_Int := 
  530.      Glib.Properties.Build ("width-chars"); 
  531.  
  532.    pragma Import (C, Get_Type, "gtk_label_get_type"); 
  533. end Gtk.Label; 
  534.  
  535. --  These subprograms never had a binding, but are now obsolescent: 
  536. --  No binding: gtk_label_get 
  537. --  No binding: gtk_label_parse_uline