parent
8d94d831e8
commit
ce819aa39f
2 changed files with 83 additions and 8 deletions
|
@ -74,6 +74,79 @@ namespace GtkDialogSample
|
||||||
}
|
}
|
||||||
</code>
|
</code>
|
||||||
</example>
|
</example>
|
||||||
|
<para>
|
||||||
|
You also can subclass the <see cref="T:Gtk.Dialog" /> when you want to use the same Dialog on several places in your application.
|
||||||
|
</para>
|
||||||
|
<example>
|
||||||
|
<code lang="C#">
|
||||||
|
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 ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</code>
|
||||||
|
</example>
|
||||||
</remarks>
|
</remarks>
|
||||||
</Docs>
|
</Docs>
|
||||||
<Base>
|
<Base>
|
||||||
|
@ -259,9 +332,9 @@ namespace GtkDialogSample
|
||||||
<ReturnType>Gtk.VBox</ReturnType>
|
<ReturnType>Gtk.VBox</ReturnType>
|
||||||
</ReturnValue>
|
</ReturnValue>
|
||||||
<Docs>
|
<Docs>
|
||||||
<summary>The <see cref="T:Gtk.VBox"/> that contains other widgets in this dialog.</summary>
|
<summary>The <see cref="T:Gtk.VBox" /> that contains other widgets in this dialog.</summary>
|
||||||
<returns>an object of type <see cref="T:Gtk.VBox" />.</returns>
|
<returns>an object of type <see cref="T:Gtk.VBox" />.</returns>
|
||||||
<remarks/>
|
<remarks />
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
<Member MemberName="HasSeparator">
|
<Member MemberName="HasSeparator">
|
||||||
|
@ -306,7 +379,7 @@ namespace GtkDialogSample
|
||||||
<Parameters />
|
<Parameters />
|
||||||
<Docs>
|
<Docs>
|
||||||
<summary>Emitted when the dialog is closed.</summary>
|
<summary>Emitted when the dialog is closed.</summary>
|
||||||
<remarks/>
|
<remarks />
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
<Member MemberName="ActionArea">
|
<Member MemberName="ActionArea">
|
||||||
|
@ -319,7 +392,7 @@ namespace GtkDialogSample
|
||||||
<Docs>
|
<Docs>
|
||||||
<summary>The area of the Dialog where the action widgets are placed.</summary>
|
<summary>The area of the Dialog where the action widgets are placed.</summary>
|
||||||
<returns>a <see cref="T:Gtk.HButtonBox" /></returns>
|
<returns>a <see cref="T:Gtk.HButtonBox" /></returns>
|
||||||
<remarks/>
|
<remarks />
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
<Member MemberName="GType">
|
<Member MemberName="GType">
|
||||||
|
@ -395,7 +468,7 @@ namespace GtkDialogSample
|
||||||
<summary>Adds a new response button to the dialog.</summary>
|
<summary>Adds a new response button to the dialog.</summary>
|
||||||
<param name="button_text">a <see cref="T:System.String" />, text for the button</param>
|
<param name="button_text">a <see cref="T:System.String" />, text for the button</param>
|
||||||
<param name="response">a <see cref="T:System.Int32" />, the numeric response code associated with the button.</param>
|
<param name="response">a <see cref="T:System.Int32" />, the numeric response code associated with the button.</param>
|
||||||
<remarks/>
|
<remarks />
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
<Member MemberName="Respond">
|
<Member MemberName="Respond">
|
||||||
|
@ -410,7 +483,7 @@ namespace GtkDialogSample
|
||||||
<Docs>
|
<Docs>
|
||||||
<summary>Activate one of the responses.</summary>
|
<summary>Activate one of the responses.</summary>
|
||||||
<param name="response">a <see cref="T:System.Int32" />, the chosen response.</param>
|
<param name="response">a <see cref="T:System.Int32" />, the chosen response.</param>
|
||||||
<remarks/>
|
<remarks />
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
<Member MemberName="DefaultResponse">
|
<Member MemberName="DefaultResponse">
|
||||||
|
@ -458,4 +531,4 @@ namespace GtkDialogSample
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
</Members>
|
</Members>
|
||||||
</Type>
|
</Type>
|
|
@ -221,6 +221,8 @@ public class TreeViewDemo {
|
||||||
}
|
}
|
||||||
</code>
|
</code>
|
||||||
</example></para>
|
</example></para>
|
||||||
|
<para>
|
||||||
|
For a example how to handle selection events see <see cref="T:Gtk.TreeSelection" /></para>
|
||||||
</remarks>
|
</remarks>
|
||||||
</Docs>
|
</Docs>
|
||||||
<Base>
|
<Base>
|
||||||
|
@ -1739,4 +1741,4 @@ tree_view.AppendColumn ("title", text, "text", 0);
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
</Members>
|
</Members>
|
||||||
</Type>
|
</Type>
|
Loading…
Add table
Reference in a new issue