[gtkada] STRINGS CONSTRAINT_ERRORS problems
Jacobo Marcos
jacobom at navegalia.com
Mon Apr 1 17:48:41 CEST 2002
------------------------------------CODE -----------------------------------
---------
with Gtk; use Gtk;
with Gtk.Main;
with Gtk.Widget; use Gtk.Widget;
with Ventana_Ppal_Pkg; use Ventana_Ppal_Pkg;
with Gtkada.Types; use Gtkada.Types;
with Gtk.Combo; use Gtk.Combo;
with Gtkada.Types; use Gtkada.Types;
with Glib; use Glib;
with Gtk.Enums; use Gtk.Enums;
procedure Sample is
Lista: String_List.Glist;
Mi_Texto: String(1..100);
begin
Gtk.Main.Set_Locale;
Gtk.Main.Init;
Gtk_New (Ventana_Ppal);
Show_All (Ventana_Ppal);
Mi_Texto:="uno"; --sample.adb:21:14: warning:
wrong length for array of subtype of "Standard.String" defined at line 13
String_List.Append(Lista,Mi_Texto);
Mi_Texto:="dos"; -- sample.adb:23:14: warning:
wrong length for array of subtype of "Standard.String" defined at line 13
String_List.Append(Lista,Mi_Texto);
Mi_Texto:="tres"; -- sample.adb:25:14:
warning: "Constraint_Error" will be raised at run time
String_List.Append(Lista,Mi_Texto);
Mi_Texto:="cuatro";
String_List.Append(Lista,Mi_Texto);
Set_PopDown_Strings(Ventana_Ppal.Combo1,Lista);
Gtk.Main.Main;
end Sample;
------------------------------------COMPILING ------------------------------
--------------
[root at localhost src]# gnatmake -gnatf sample.adb `gtkada-config`
gcc -c -gnatf -I/usr/gnat/include/gtkada sample.adb
sample.adb:21:14: warning: wrong length for array of subtype of
"Standard.String" defined at line 13
sample.adb:21:14: warning: "Constraint_Error" will be raised at run time
sample.adb:23:14: warning: wrong length for array of subtype of
"Standard.String" defined at line 13
sample.adb:23:14: warning: "Constraint_Error" will be raised at run time
sample.adb:25:14: warning: wrong length for array of subtype of
"Standard.String" defined at line 13
sample.adb:25:14: warning: "Constraint_Error" will be raised at run time
sample.adb:27:14: warning: wrong length for array of subtype of
"Standard.String" defined at line 13
sample.adb:27:14: warning: "Constraint_Error" will be raised at run time
gnatbind -aO./ -aO/usr/gnat/include/gtkada -I- -x sample.ali
IMPORTANT NOTICE:
.
.
.
--------------------------------EXECUTING-----------------------------------
------------
[root at localhost src]# ./sample
raised CONSTRAINT_ERROR : sample.adb:21
THE QUESTION IS:
What`s going wrong with Strings in Ada(GNAT 3.13) and GTKAda ?
I don´t understand WARNINGS abaut CONSTRAINT_ERROR raises
TANKS
More information about the gtkada
mailing list