hide() show() make my program ends



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




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