Re: how to make a button not close a gtk_dialog?



Am Sam, 2002-10-19 um 14.14 schrieb Olexiy Avramchenko:
Joergen Scheibengruber wrote:

Hello, Jörgen
As I know gtk itself doesnt destroy the dialog. You have to do
this in "response" callback or after gtk_dialog_run() or another
way you want.
Maybe you have "response" callback that destroys the dialog
without checking *response* vaule (BTW, GTK_RESPONSE_HELP
in your case) ? Are you keeping in mind that you can connect
more than one callback to a signal ?
You can post the piece of your source, dealing with dialog, - this will
help to find the problem.

Olexiy

Your right. I am calling gtk_widget_destroy(dialog); after
gtk_dialog_run() has returned. Stupid me :-(

So I simply do the following now, which solves the problem:

choise = GTK_RESPONSE_HELP;
while (choise == GTK_RESPONSE_HELP)
{
        choise = gtk_dialog_run(GTK_DIALOG(dialog)); 
        switch (choise)
        {
        
                case GTK_RESPONSE_HELP:
                        display_help_cb("foo");
                break;
                case GTK_RESPONSE_OK:
                        gtk_widget_destroy(dialog);
                        commit_settings(app);
                        break;
                default:
                        gtk_widget_destroy(dialog);
                        rollback_settings();
        }
}

Thanks for your help... Sometimes blindness really hurts. I have been
coding different (more complicated) solutions for 2 hours, just because
I asumed that gtk_dialog_run() does destroy the dialog... oh man.

Jörgen





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