1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
Index: libgtkada2-2.8.1/src/gtk-dialog.ads
===================================================================
--- libgtkada2-2.8.1.orig/src/gtk-dialog.ads 2007-08-02 22:42:39.289756028 +0200
+++ libgtkada2-2.8.1/src/gtk-dialog.ads 2007-08-02 22:43:01.921265956 +0200
@@ -46,6 +46,8 @@
-- <testgtk>create_dialog.adb</testgtk>
-- <screenshot>gtk-dialog</screenshot>
+with Interfaces.C;
+
with Glib.Properties;
with Gtk.Box;
with Gtk.Widget;
@@ -60,11 +62,10 @@
-- Enumeration types --
-----------------------
- type Gtk_Dialog_Flags is mod 3;
- pragma Convention (C, Gtk_Dialog_Flags);
- Modal : constant Gtk_Dialog_Flags := 0;
- Destroy_With_Parent : constant Gtk_Dialog_Flags := 1;
- No_Separator : constant Gtk_Dialog_Flags := 2;
+ type Gtk_Dialog_Flags is new Interfaces.C.int;
+ Modal : constant Gtk_Dialog_Flags := 2 ** 0;
+ Destroy_With_Parent : constant Gtk_Dialog_Flags := 2 ** 1;
+ No_Separator : constant Gtk_Dialog_Flags := 2 ** 2;
-- Various flags that can be set for the dialog, with the following
-- implications:
-- - Modal : the dialog is modal, see Gtk.Window.Set_Modal
@@ -72,6 +73,12 @@
-- destroyed. See Gtk.Window.Set_Destroy_With_Parent
-- - No_Separator: No separator bar above the buttons.
+ -- ??? The C definition of this type is wrong, as they use an enumeration
+ -- for values that can be added together, as shown in the example for
+ -- gtk_dialog_new_with_buttons. In fact this is really a bit field. Per C
+ -- rules, enumerations are implicitly converted to "int", so we base the
+ -- Gtk_Dialog_Flags on that.
+
type Gtk_Response_Type is new Gint;
-- Type used for Response_Id's.
-- Positive values are totally user-interpreted.
Index: libgtkada2-2.8.1/src/gtkada-dialogs.adb
===================================================================
--- libgtkada2-2.8.1.orig/src/gtkada-dialogs.adb 2007-08-02 22:42:39.333755075 +0200
+++ libgtkada2-2.8.1/src/gtkada-dialogs.adb 2007-08-02 22:43:01.921265956 +0200
@@ -229,7 +229,7 @@
(Dialog,
Title => Title,
Parent => Parent,
- Flags => Modal or Destroy_With_Parent);
+ Flags => Modal + Destroy_With_Parent);
-- Realize it so that we force the creation of its Gdk_Window.
-- This is needed below to create a pixmap.
Index: libgtkada2-2.8.1/src/gtkada-mdi.adb
===================================================================
--- libgtkada2-2.8.1.orig/src/gtkada-mdi.adb 2007-08-02 23:07:02.314158152 +0200
+++ libgtkada2-2.8.1/src/gtkada-mdi.adb 2007-08-02 23:07:07.910037024 +0200
@@ -2900,7 +2900,7 @@
Gtk_New (Diag,
Title => Child.Title.all,
Parent => Parent,
- Flags => No_Separator or Destroy_With_Parent);
+ Flags => No_Separator + Destroy_With_Parent);
end;
Set_Has_Separator (Diag, False);
|