RE: Dialog closing prematurely with response code of 0



I wasn't expecting you to be able to compile the code since it is a small
piece of a much larger application.  From a quick review of your attached
code it looks like each of the dialogs gtk_dialog_run() drops out to select
the next dialog and thus is not an arbitrary depth.  You are processing the
response value of each dialog to see whether you need the next dialog to
appear which is not the behaviour I am looking for.  

I have a button in DispenserLoadDialog that launches DispenserLoadingDialog
without emitting a return value for DispenserLoadDialog.  The response value
from DispenserLoadingDialog is only supposed to be caught by the buttons
code and shouldn't be causing gtk_dialog_run() in DispenserLoadDialog to
return with an invalid response.

DispenserLoadDialog->gtk_dialog_run() started with the DispenserLoadDialog
dialog pointer passed in
        Load Button pushed which causes load_button_clicked to be executed
        load_button_clicked() launches DispenserLoadingDialog()

        DispenserLoadingDialog->gtk_dialog_run() started with the
DispenserLoadingDialog dialog pointer passed in
        Ok button in DispenserLoadingDialog pressed which causes
ok_button_clicked to be executed
        ok_button_clicked() calls gtk_dialog_response() with GTK_RESPONSE_OK
and the DispenserLoadingDialog pointer as the first parameter

        load_button_clicked() finishes executing WITHOUT calling 

DispenserLoadDialog->gtk_dialog_run() returns with a response code of 0
(which is invalid as far as the documenation is concerned).

Kevin


-----Original Message-----
From: gtk-app-devel-list-bounces gnome org
[mailto:gtk-app-devel-list-bounces gnome org] On Behalf Of David Neèas
(Yeti)
Sent: Thursday, March 22, 2007 9:09 AM
To: gtk-app-devel-list gnome org
Subject: Re: Dialog closing prematurely with response code of 0


On Thu, Mar 22, 2007 at 08:53:34AM -0400, Kevin Lambert wrote:
Evidentally nothing, I don't know how many people have a GtkWindow 
kicking off a GtkDialog which then kicks off another GtkDialog...

I have.  Moreover, the attached code demonstrated arbitrary deep nesting of
modal dialogs that works.

DispenserLoadDialog::load_button_clicked() kicks off 
DispenserLoadingDialog. When either 
DispenserLoadingDialog::ok_button_clicked() or
DispenserLoadingDialog::cancel_button_clicked() are pressed the
DispenserLoadingDialog is removed and
DispenserLoadDialog::load_button_clicked() finishes executing but then the
gtk_dialog_run in DispenserLoadDialog returns with a response id of 0.

If this is the code, how does one compile and execute it?

Well, at least we have found you have the problem in some bindings with some
unknown custom dialog class.

Yeti

--
http://gwyddion.net/ _______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]