Re: hide() show() make my program ends



Bob Caryl wrote:

cyril ponsan wrote:

Good evening,

im facing a new issue, in the program im writting, i have to open a Gtk::MessageDialog (this is ok for that) but i wish that the main window is not visible while the message dialog is open ...

so i wrote this function :

void AssistantCadre::on_button_1_clicked()
{
    asso.setNameDate(entry_1.get_text(), "today"); // some stuff to do
if (asso.checkConf()) // boolean return to check if the stuff has been well done
    {
        this->hide_all();
Gtk::MessageDialog dialog1(*this, "\nVotre association est enregistrée.");
        dialog1.set_title("Confirmation"); // excuse me im french ;)
        dialog1.run();
        Gtk::Main::quit();  // stuff has been done so the prog quit
    }
    else
    {
        this->hide_all();
        Gtk::MessageDialog dialog2(*this, "\nUne erreur est survenue.");
        dialog2.set_title("Erreur");
        dialog2.run();
        this->show_all();
    }
}


when i run the prog, and i test the negative part of the "if" the main window is hidden, the dialog open, i click, i see the main window appearing and boum the prog is finish with no error (except that he sould not have finish lol)

dont know what is the issue with hide() function, i tested without it is ok, i tried commenting the portion of code dealing with the Gtk::MessageDialog and the problem is still here so this must be the hide() fonction...

cheers for any answer,

good week end to you :)

_________________________________________________________________
MSN Search : des réponses à tous vos besoins ! http://www.imagine-msn.com/hotmail/default.aspx?locale=fr-FR

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Hiding your main window ends the Gtk::Main::run loop and hence ends your program. I am not sure about this, but perhaps you could minimize your window before you display the error message dialog, and then restore it afterwards.

Bob
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

DOH! My windows background is showing.. the term I should have used is "iconify" and "deiconify" which are the window functions you would use... sorry about that.

Bob



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