diff --git a/doc/en/Gtk/Dialog.xml b/doc/en/Gtk/Dialog.xml index cf894a2c8..2ffdbdb12 100644 --- a/doc/en/Gtk/Dialog.xml +++ b/doc/en/Gtk/Dialog.xml @@ -74,6 +74,79 @@ namespace GtkDialogSample } + +You also can subclass the when you want to use the same Dialog on several places in your application. + + + +using System; +using Gtk; + +namespace GtkDialogSample +{ + + public class MyDialog:Dialog + { + + public MyDialog(Window w,DialogFlags f ):base("Sample", w, f) + { + this.Modal = true; + this.AddButton ("Close", ResponseType.Close); + } + + protected override void OnResponse (ResponseType response_id){ + Console.WriteLine (response_id); + } + + + } + + + + public class GtkDialogSample + { + MyDialog dialog; + Window win; + + static void Main() + { + new GtkDialogSample (); + } + + GtkDialogSample () + { + Application.Init (); + win = new Window ("Test"); + win.SetDefaultSize (250, 250); + win.DeleteEvent += new DeleteEventHandler (on_win_delete); + + Button btn = new Button ("Show About"); + btn.Clicked += new EventHandler (on_btn_clicked); + win.Add (btn); + + win.ShowAll (); + Application.Run (); + } + + void on_btn_clicked (object obj, EventArgs args) + { + dialog = new MyDialog(win, Gtk.DialogFlags.DestroyWithParent); + dialog.Run (); + dialog.Destroy (); + } + + + + void on_win_delete (object obj, DeleteEventArgs args) + { + Application.Quit (); + } + } + +} + + + @@ -259,9 +332,9 @@ namespace GtkDialogSample Gtk.VBox - The that contains other widgets in this dialog. + The that contains other widgets in this dialog. an object of type . - + @@ -306,7 +379,7 @@ namespace GtkDialogSample Emitted when the dialog is closed. - + @@ -319,7 +392,7 @@ namespace GtkDialogSample The area of the Dialog where the action widgets are placed. a - + @@ -395,7 +468,7 @@ namespace GtkDialogSample Adds a new response button to the dialog. a , text for the button a , the numeric response code associated with the button. - + @@ -410,7 +483,7 @@ namespace GtkDialogSample Activate one of the responses. a , the chosen response. - + @@ -458,4 +531,4 @@ namespace GtkDialogSample - + \ No newline at end of file diff --git a/doc/en/Gtk/TreeView.xml b/doc/en/Gtk/TreeView.xml index 0d21274b4..f208f08d0 100644 --- a/doc/en/Gtk/TreeView.xml +++ b/doc/en/Gtk/TreeView.xml @@ -221,6 +221,8 @@ public class TreeViewDemo { } + +For a example how to handle selection events see @@ -1739,4 +1741,4 @@ tree_view.AppendColumn ("title", text, "text", 0); - + \ No newline at end of file