How respond to more than one click on the same dialog button

The second time that clicked on one dialog button not response.
I need process a bucle (more than one time) os signals from
a Dialog button, “SAVE” for example. In the case of a error may be.
Can i do with a “Dialog” or i have to use a “Window”

On Wed, Jan 23, 2008 at 09:23:49PM +0100, Mil L. wrote:

The second time that clicked on one dialog button not response.
I need process a bucle (more than one time) os signals from
a Dialog button, “SAVE” for example. In the case of a error may be.
Can i do with a “Dialog” or i have to use a “Window”

Hi Mil,

Your post is a little hard to follow :wink:
But it seems you just want to be able to click on a dialog button
multiple times?
If yes, you just have to connect to the ‘response’ signal of Gtk::Dialog
instead of calling
the run() method, which destroys the window after the first response.

There’s an example at
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ADialog

Also, if you want the dialog to be modal, you have to set it explicitly
with
set_modal(true). run() also does this automatically.

Cheers,
Markus

First Excuseme by the text, I am Ecuadorian and my english
is very bay, ‘like Vista’, je je je …

Thanks very very very much Markus (where are yu from) by your response
help me much
, You understand efectively my question.

Before your response i am thinking may use response,
now you confirm, and i learne some things.

On Thu, Jan 24, 2008 at 02:12:45PM +0100, Mil L. wrote:

First Excuseme by the text, I am Ecuadorian and my english
is very bay, ‘like Vista’, je je je …

Thanks very very very much Markus (where are yu from) by your response
help me much
, You understand efectively my question.

Absolutely no problem, I’m glad to help you :wink:

Cheers,
Markus (from Switzerland)

Ups, i can tell you that i intent solve coding
de response but i don’t know how do it.

I probe :

class MyDialogo < Gtk::Dialog

def initialize

self.signal_connect( Gtk::DIalog.RESPONSE_OK ){

my code, but no function

}

end

I read in the API that dialog.response is to emit signal,
not for process the signal

help me

Hi

Take a look at the Gtk::Dialog signals. There is only the “response” and
the “close” signal. So your signal connection handler has to look like:

self.signal_connect(‘response’) do |dialog, response_id|

handle the response_id

if response_id == Gtk::Dialog::RESPONSE_OK

do something

end
end

Cheers, detlef

Am Freitag, den 25.01.2008, 17:35 +0100 schrieb Mil L.:

Thanks you.

Its really work.

But i question why the Gnome2 API docs not show:
signal_connect(‘response’) do |dialog, response_id| …
(I not yet understand this constructions in ruby)
and only show:
response(‘response’)

Hi,

you are looking at the methodes and with

response(‘response’)

you create a synthetic response signal. Go down the page to the signals
and you will find:

Signals
close: self (Run last / Action)
* self: Gtk::Dialog
response: self, response_id (Run last)
Emitted when an action widget is clicked, the dialog receives a
delete event, or the application programmer calls
Gtk::Dialog#response. On a delete event, the response ID is
Gtk::Dialog::RESPONSE_NONE. Otherwise, it depends on which
action widget was clicked.
* self: Gtk::Dialog
* response_id: the response_id

Am Donnerstag, den 31.01.2008, 13:58 +0100 schrieb Mil L.:

Gtk::DIalog.RESPONSE_OK

Hmm are you sure that this Constant is right?
DIalog seems a bit weird.