Enlisting the Gtk.Dialog.Close event from another dialog is never triggered (C# mono) -


i'm enlisting gtk.dialog close event dialog this:

addtask dialog = new addtask (task); //addtask inherits gtk.dialog dialog.close += handledialogclose; dialog.show();  void handledialogclose (object sender, eventargs e) {     refresh(); //does stuff in calling dialog } 

when close dialog (the 1 created above), handledialogclose event never triggered. idea why?

here sample code, , solved myself. enlisting close() event, when should have been enlisting destroyed() event. code below works (the commented code not working).

using system; using gtk;  namespace test {     public partial class mainwindow: gtk.window     {            public mainwindow (): base (gtk.windowtype.toplevel)         {             build ();             button button1 = new button();             button1.label = "open about";             this.add(button1);             button1.show();             button1.clicked += handlebutton1clicked;         }          void handlebutton1clicked (object sender, eventargs e)         {             dialog = new about();             //dialog.close += handleaboutclose;             dialog.destroyed += handleaboutclose;             dialog.show();         }          protected void ondeleteevent (object sender, deleteeventargs a)         {             application.quit ();             a.retval = true;         }          void handleaboutclose (object sender, eventargs e)         {             console.writeline("about closed");         }     } } 

i needed use

dialog.destroyed += handleaboutclose; 

instead of

dialog.close += handleaboutclose; 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -