From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE, STOX_REPLY_TYPE_WITHOUT_QUOTES,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,76d0380dc6d9ac2c,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!feeds.phibee-telecom.net!feeder.news-service.com!feed.xsnews.nl!border-1.ams.xsnews.nl!upload-1.xsnews.nl!10.10.60.1.MISMATCH!frontend-F10-01.ams.textnews.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada Subject: Trying to learn Gtk Ada Date: Thu, 7 Jul 2011 15:15:20 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3508.1109 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109 Message-ID: <4e15b1f4$0$6712$703f8584@textnews.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1310044660 textnews.kpn.nl 6712 77.168.179.107@kpn/77.168.179.107:63635 Xref: g2news1.google.com comp.lang.ada:20115 Date: 2011-07-07T15:15:20+02:00 List-Id: 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 -- View this message in context: http://old.nabble.com/Learn-to-use-GtkAda-tp32012833p32012833.html Sent from the Gtk+ - Ada mailing list archive at Nabble.com.