~ubuntu-branches/ubuntu/intrepid/libgtkada2/intrepid

« back to all changes in this revision

Viewing changes to src/gtk-menu_tool_button.adb

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-08-11 09:46:51 UTC
  • mfrom: (6.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20080811094651-9mjd6acwa98ffw5c
Tags: 2.12.0-2ubuntu1
Add lpia to supported architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
-----------------------------------------------------------------------
2
2
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
3
3
--                                                                   --
 
4
--                 Copyright (C) 2006-2008, AdaCore                  --
4
5
--                                                                   --
5
6
-- This library is free software; you can redistribute it and/or     --
6
7
-- modify it under the terms of the GNU General Public               --
20
20
--                                                                   --
21
21
-----------------------------------------------------------------------
22
22
 
 
23
with Gtkada.Bindings;      use Gtkada.Bindings;
23
24
with Gtk.Menu;             use Gtk.Menu;
24
25
with Gtk.Tooltips;         use Gtk.Tooltips;
25
26
with Gtk.Widget;           use Gtk.Widget;
26
27
with Interfaces.C.Strings; use Interfaces.C.Strings;
27
28
with System;
28
29
 
 
30
with Glib.Type_Conversion_Hooks;
 
31
 
29
32
package body Gtk.Menu_Tool_Button is
30
33
 
 
34
   package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
 
35
     (Get_Type'Access, Gtk_Menu_Tool_Button_Record);
 
36
   pragma Warnings (Off, Type_Conversion);
 
37
 
31
38
   --------------
32
39
   -- Get_Menu --
33
40
   --------------
72
79
         Label       : chars_ptr)
73
80
         return System.Address;
74
81
      pragma Import (C, Internal, "gtk_menu_tool_button_new");
75
 
      Str : chars_ptr := Null_Ptr;
 
82
      Str : chars_ptr := String_Or_Null (Label);
76
83
      Obj : System.Address := System.Null_Address;
77
84
   begin
78
 
      if Label /= "" then
79
 
         Str := New_String (Label);
80
 
      end if;
81
85
      if Icon_Widget /= null then
82
86
         Obj := Get_Object (Icon_Widget);
83
87
      end if;