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=-1.5 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,33defb6569eefe4c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!multikabel.net!newsfeed10.multikabel.net!xlned.com!feeder7.xlned.com!feed.xsnews.nl!border-1.ams.xsnews.nl!upload-1.xsnews.nl!10.10.69.16.MISMATCH!frontend-F09-16.ams.news.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada References: <4e182fbc$0$2558$703f8584@news.kpn.nl> In-Reply-To: Subject: Re: response on OK button Date: Tue, 12 Jul 2011 12:10:47 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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: <4e1c1dd4$0$2562$703f8584@news.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1310465492 news.kpn.nl 2562 77.168.179.107@kpn/77.168.179.107:63177 Xref: g2news1.google.com comp.lang.ada:20178 Date: 2011-07-12T12:10:47+02:00 List-Id: Dimitry, You are correct that I didn't send the complete code. The answer you gave solved the problem. I saw in filechooser example the same way of inserting the buttons. Maybe you can answer the following question. I created the code with Glade 2. In the initialize rotine the code generated is 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); I just used Stock items so I thought I could just assume that they should work without being created from the outside. Maybe I am spoiled by using Microsoft Visual Studio. L. Dries "Dmitry A. Kazakov" schreef in bericht news:wo75xb7mq2eq$.1ehqghgzzsg19.dlg@40tude.net... On Sat, 9 Jul 2011 12:37:58 +0200, ldries46 wrote: > I created a dialog with an OK and a cancel button. > When I call the dialog using Run(dialog) only the quit button of the > window > gives a response. The OK and the Cancel button do not even give any > response. I found this by using the Debug facility of GPS. > > What do I do wrong. 1. You didn't post the complete code 2. You were running GTK under the debugger, which might lead to unpredictable results. > I expected the buttons to react with giving the > gtk_response_OK or _Cancel value retuirned by Run As a general note, when adding buttons to the dialog you have to use Add_Button, which specifies the response for the button being added. If you don't do that, simply placing a button into the dialog as a container, you have to catch the signal emitted by the button and close the dialog manually from the handler. Either method works. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de