INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Learning GtkADA

Learning GtkADA

(OP)
I am trying to use GtkAda.
At this moment I have created with Glade-2 a dialog with one Label a
Combobox and two buttons.
The program using this dialog compiles without errors.
But when I execute Run(Sphere_Level) I get an empty dialog.

The relevant code is:
      Gtk_New(Sphere_Level);
      if Run(Sphere_Level) = Gtk_Response_OK then
         n3 := Sphere_Level.Levelselection;
      end if;
      Hide(Sphere_Level);
      Destroy(Sphere_Level);

Where the Initialize routine is (created by Glade-2):

procedure Initialize (Sphere_Level : access Sphere_Level_Record'Class) is
   pragma Suppress (All_Checks);
   Pixmaps_Dir : constant String := "pixmaps/";
   Levelselection_Items : String_List.Glist;

begin
   Gtk.Dialog.Initialize (Sphere_Level);
   Set_Title (Sphere_Level, -"Sphere Level");
   Set_Position (Sphere_Level, Win_Pos_None);
   Set_Modal (Sphere_Level, False);
   Set_Resizable (Sphere_Level, True);



   Gtk_New_From_Stock (Sphere_Level.Cancelbutton1, "gtk-cancel");
   Set_Relief (Sphere_Level.Cancelbutton1, Relief_Normal);

   Set_Flags (Sphere_Level.Cancelbutton1, Can_Default);
   Pack_Start (Get_Action_Area (Sphere_Level), Sphere_Level.Cancelbutton1);
   Gtk_New_From_Stock (Sphere_Level.Okbutton1, "gtk-ok");
   Set_Relief (Sphere_Level.Okbutton1, Relief_Normal);

   Set_Flags (Sphere_Level.Okbutton1, Can_Default);
   Pack_Start (Get_Action_Area (Sphere_Level), Sphere_Level.Okbutton1);
   Gtk_New_Hbox (Sphere_Level.Hbox1, False, 0);

   Gtk_New (Sphere_Level.Label1, -("Degree of subdivision" & ASCII.LF & "(1
= basic)"));
   Set_Alignment (Sphere_Level.Label1, 0.5, 0.5);
   Set_Padding (Sphere_Level.Label1, 23, 0);
   Set_Justify (Sphere_Level.Label1, Justify_Left);
   Set_Line_Wrap (Sphere_Level.Label1, False);
   Set_Selectable (Sphere_Level.Label1, False);
   Set_Use_Markup (Sphere_Level.Label1, False);
   Set_Use_Underline (Sphere_Level.Label1, False);

   Pack_Start
     (Sphere_Level.Hbox1,
      Sphere_Level.Label1,
      Expand  => False,
      Fill    => False,
      Padding => 0);
   Gtk_New (Sphere_Level.Levelselection);
   Set_Value_In_List (Sphere_Level.Levelselection, False);
   Set_Use_Arrows (Sphere_Level.Levelselection, True);
   Set_Case_Sensitive (Sphere_Level.Levelselection, False);
   Set_Editable (Get_Entry (Sphere_Level.Levelselection), False);
   Set_Has_Frame (Get_Entry (Sphere_Level.Levelselection), True);
   Set_Max_Length (Get_Entry (Sphere_Level.Levelselection), 2);
   Set_Width_Chars (Get_Entry (Sphere_Level.Levelselection), 2);
   Set_Text (Get_Entry (Sphere_Level.Levelselection), -(""));
   Set_Invisible_Char (Get_Entry (Sphere_Level.Levelselection),
UTF8_Get_Char ("●"));
   Set_Has_Frame (Get_Entry (Sphere_Level.Levelselection), True);
   String_List.Append (Levelselection_Items, -("1"));
   String_List.Append (Levelselection_Items, -("2"));
   String_List.Append (Levelselection_Items, -("3"));
   String_List.Append (Levelselection_Items, -("4"));
   String_List.Append (Levelselection_Items, -("5"));
   String_List.Append (Levelselection_Items, -("6"));
   String_List.Append (Levelselection_Items, -("7"));
   String_List.Append (Levelselection_Items, -("8"));
   String_List.Append (Levelselection_Items, -("9"));
   Combo.Set_Popdown_Strings (Sphere_Level.Levelselection,
Levelselection_Items);
   Free_String_List (Levelselection_Items);


   Pack_Start
     (Sphere_Level.Hbox1,
      Sphere_Level.Levelselection,
      Expand  => True,
      Fill    => True,
      Padding => 0);
   Pack_Start
     (Get_Vbox (Sphere_Level),
      Sphere_Level.Hbox1,
      Expand  => True,
      Fill    => True,
      Padding => 0);

   --  Connect signals

end Initialize;

I am convinced that I forget something but I tried to find anything to learn
from on the internet, but I cannot find anything.
You can help me by explaning what I forgot or by sending a link where I can
find the relevant parts

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close