comp.lang.ada
 help / color / mirror / Atom feed
From: "ldries46" <bertus.dries@planet.nl>
Subject: Re: response on OK button
Date: Tue, 12 Jul 2011 12:10:47 +0200
Date: 2011-07-12T12:10:47+02:00	[thread overview]
Message-ID: <4e1c1dd4$0$2562$703f8584@news.kpn.nl> (raw)
In-Reply-To: <wo75xb7mq2eq$.1ehqghgzzsg19.dlg@40tude.net>

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 




  reply	other threads:[~2011-07-12 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-09 10:37 response on OK button ldries46
2011-07-09 12:14 ` Dmitry A. Kazakov
2011-07-12 10:10   ` ldries46 [this message]
2011-07-12 15:15     ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox