[Gtk-sharp-list] Trouble when closing

xiii29 xiii29@free.fr
Sun, 24 Apr 2005 11:37:08 +0200


Hi,
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 !