mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-23 01:10:58 +00:00
add DrawingArea example
document TargetFlags svn path=/trunk/gtk-sharp/; revision=26093
This commit is contained in:
parent
f5aa31077b
commit
3027f1a0c1
|
@ -1,6 +1,7 @@
|
|||
2004-04-27 John Luke <jluke@cfl.rr.com>
|
||||
|
||||
* en/Gdk/Threads.xml: document
|
||||
* en/Gtk/TargetFlags.xml: document
|
||||
* en/Gtk/TreeSelection.xml: add example
|
||||
* en/Pango/Layout.xml: add example of drawing text to a Layout
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</AssemblyInfo>
|
||||
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
|
||||
<Docs>
|
||||
<summary>The GtkDrawingArea widget is used for creating custom user interface elements.</summary>
|
||||
<summary>The <see cref="T:Gtk.DrawingArea" /> widget is used for creating custom user interface elements.</summary>
|
||||
<remarks>
|
||||
<para>
|
||||
The <see cref="T:Gtk.DrawingArea" /> widget is used for creating custom user interface elements. It's essentially a blank widget; you can draw on <paramref name="widget" />->window. After creating a drawing area, the application may want to connect to: <para>
|
||||
|
@ -25,6 +25,55 @@
|
|||
Expose events are normally delivered when a drawing area first comes onscreen, or when it's covered by another window and then uncovered (exposed). You can also force an expose event by adding to the "damage region" of the drawing area's window; <see cref="M:Gtk.Widget.QueueDrawArea" /> and <see cref="M:Gdk.Window.InvalidateRect" /> are equally good ways to do this. You'll then get an expose event for the invalid region. See also <see cref="M:Gdk.Pixbuf.RenderToDrawable" /> for drawing a <see cref="T:Gdk.Pixbuf" />.
|
||||
</para>
|
||||
</remarks>
|
||||
<example>
|
||||
<code lang="C#">
|
||||
using System;
|
||||
using Gtk;
|
||||
using Pango;
|
||||
|
||||
class LayoutSample : DrawingArea
|
||||
{
|
||||
Pango.Layout layout;
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
Application.Init ();
|
||||
new LayoutSample ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
LayoutSample ()
|
||||
{
|
||||
Window win = new Window ("Layout sample");
|
||||
win.SetDefaultSize (400, 300);
|
||||
win.DeleteEvent += OnWinDelete;
|
||||
this.Realized += OnRealized;
|
||||
this.ExposeEvent += OnExposed;
|
||||
|
||||
win.Add (this);
|
||||
win.ShowAll ();
|
||||
}
|
||||
|
||||
void OnExposed (object o, ExposeEventArgs args)
|
||||
{
|
||||
this.GdkWindow.DrawLayout (this.Style.TextGC (StateType.Normal), 100, 150, layout);
|
||||
}
|
||||
|
||||
void OnRealized (object o, EventArgs args)
|
||||
{
|
||||
layout = new Pango.Layout (this.PangoContext);
|
||||
layout.Wrap = Pango.WrapMode.Word;
|
||||
layout.FontDescription = FontDescription.FromString ("Tahoma 16");
|
||||
layout.SetMarkup ("Hello Pango.Layout");
|
||||
}
|
||||
|
||||
void OnWinDelete (object o, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>Gtk.Widget</BaseTypeName>
|
||||
|
@ -112,4 +161,4 @@
|
|||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
||||
</Type>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<Type Name="TargetFlags" FullName="Gtk.TargetFlags">
|
||||
<TypeSignature Language="C#" Maintainer="auto" Value="public enum TargetFlags;" />
|
||||
<TypeSignature Language="C#" Maintainer="John Luke" Value="public enum TargetFlags;" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>gtk-sharp</AssemblyName>
|
||||
<AssemblyPublicKey>
|
||||
|
@ -10,8 +10,8 @@
|
|||
</AssemblyInfo>
|
||||
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<remarks>To be added</remarks>
|
||||
<summary>The <see cref="T:Gtk.TargetFlags" /> enumeration is used to specify constraints on an entry in a <see cref="T:Gtk.TargetTable" />.</summary>
|
||||
<remarks></remarks>
|
||||
</Docs>
|
||||
<Base>
|
||||
<BaseTypeName>System.Enum</BaseTypeName>
|
||||
|
@ -37,8 +37,8 @@
|
|||
</ReturnValue>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<remarks>To be added</remarks>
|
||||
<summary> If this is set, the target will only be selected for drags within a single application.</summary>
|
||||
<remarks></remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Widget">
|
||||
|
@ -49,8 +49,8 @@
|
|||
</ReturnValue>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<remarks>To be added</remarks>
|
||||
<summary> If this is set, the target will only be selected for drags within a single widget.</summary>
|
||||
<remarks></remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="value__">
|
||||
|
@ -61,9 +61,9 @@
|
|||
</ReturnValue>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<remarks>To be added</remarks>
|
||||
<summary></summary>
|
||||
<remarks></remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
||||
</Type>
|
||||
|
|
Loading…
Reference in a new issue