I've created a window wich inherits from Gtk.Dialog. During the building I'm using:
this.AddButton (Stock.Ok, ResponseType.Ok);
this.AddButton (Stock.Cancel, ResponseType.Cancel);
this.Response += new ResponseHandler(this.gererClickBoutonsActions);
Then I handle the event where I want to close the window by using :
private void gererClickBoutonsActions(object o, ResponseArgs args) {
switch(args.ResponseId) {
// OK
case(ResponseType.Ok) :
this.gererValider();
break;
// Cancel
case(ResponseType.Cancel) :
this.HideAll();
break;
} // Fin du switch
}Everything goes well until I show a MessageDialog then I have such message in the console :
(<unknown>:6905): Gtk-CRITICAL **: gtk_widget_hide_all: assertion `GTK_IS_WIDGET (widget)' failed
For info, here is the code I'm using to show a message :
private void gererValider() {
//-1-
if(this.valider()) {
//-1.a- D�pend s'il s'agit d'un ajout ou d'une modification
if(this.data == null) { this.creer(); }
else { this.modifier(); }
//-1.b-
this.HideAll();
} else {
Message.EnvoyerErreur(this, "Donn�es incorrectes. V�rifiez votre saisie.");
}
}
public static void EnvoyerErreur(Window pfrmParent, string pstrMessage) {
Message.envoyer(pfrmParent, pstrMessage, MessageType.Error, ButtonsType.Ok);
}
private static int envoyer(Window pfrmParent, string pstrMessage, MessageType penmMsgType, ButtonsType penmBtnType) {
//Console.WriteLine( ((System.Reflection.MethodBase) System.Reflection.MethodInfo.GetCurrentMethod()).Name);
//-1- D�claration
MessageDialog md = new MessageDialog(pfrmParent, DialogFlags.DestroyWithParent, penmMsgType, penmBtnType, pstrMessage);
//-2- Affichage
int intReturn = md.Run();
//-3-
md.HideAll();
md.Destroy();
//-4-
return intReturn;
}
Thanks for any help !
_______________________________________________ Gtk-sharp-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
