mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-26 18:35:38 +00:00
a8b81fb34d
svn path=/trunk/gtk-sharp/; revision=32766
165 lines
6.6 KiB
XML
165 lines
6.6 KiB
XML
<Type Name="DrawingArea" FullName="Gtk.DrawingArea">
|
|
<TypeSignature Language="C#" Value="public class DrawingArea : Gtk.Widget, Implementor, IWrapper, IWrapper, IDisposable" Maintainer="Hector Gomez M" />
|
|
<AssemblyInfo>
|
|
<AssemblyName>gtk-sharp</AssemblyName>
|
|
<AssemblyPublicKey>
|
|
</AssemblyPublicKey>
|
|
<AssemblyVersion>0.0.0.0</AssemblyVersion>
|
|
<AssemblyCulture>neutral</AssemblyCulture>
|
|
<Attributes />
|
|
</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 <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:
|
|
<list type="bullet">
|
|
<item><term> 1) Mouse and button press signals to respond to input from the user. (Use <see cref="M:Gtk.Widget.AddEvents" /> to enable events you wish to receive).</term></item>
|
|
<item><term> 2) The <paramref name="realize" /> signal to take any necessary actions when the widget is instantiated on a particular display. (Create GDK resources in response to this signal.)</term></item>
|
|
<item><term> 3) The <paramref name="configure_event" /> signal to take any necessary actions when the widget changes size.</term></item>
|
|
<item><term> 4) The <paramref name="expose_event" /> signal to handle redrawing the contents of the widget.</term></item>
|
|
</list>
|
|
</para>
|
|
<para>
|
|
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>
|
|
</Base>
|
|
<Interfaces>
|
|
<Interface>
|
|
<InterfaceName>Atk.Implementor</InterfaceName>
|
|
</Interface>
|
|
<Interface>
|
|
<InterfaceName>GLib.IWrapper</InterfaceName>
|
|
</Interface>
|
|
<Interface>
|
|
<InterfaceName>GLib.IWrapper</InterfaceName>
|
|
</Interface>
|
|
<Interface>
|
|
<InterfaceName>System.IDisposable</InterfaceName>
|
|
</Interface>
|
|
</Interfaces>
|
|
<Attributes />
|
|
<Members>
|
|
<Member MemberName="Finalize">
|
|
<MemberSignature Language="C#" Value="protected override void Finalize ();" />
|
|
<MemberType>Method</MemberType>
|
|
<ReturnValue>
|
|
<ReturnType>System.Void</ReturnType>
|
|
</ReturnValue>
|
|
<Parameters />
|
|
<Docs>
|
|
<summary>Disposes the resources associated with the object.</summary>
|
|
<remarks />
|
|
</Docs>
|
|
</Member>
|
|
<Member MemberName=".ctor">
|
|
<MemberSignature Language="C#" Value="public DrawingArea (IntPtr raw);" />
|
|
<MemberType>Constructor</MemberType>
|
|
<ReturnValue />
|
|
<Parameters>
|
|
<Parameter Name="raw" Type="System.IntPtr" />
|
|
</Parameters>
|
|
<Docs>
|
|
<summary>Internal constructor</summary>
|
|
<param name="raw">Pointer to the C object.</param>
|
|
<returns>An instance of DrawingArea, wrapping the C object.</returns>
|
|
<remarks>
|
|
<para>This is an internal constructor, and should not be used by user code.</para>
|
|
</remarks>
|
|
</Docs>
|
|
</Member>
|
|
<Member MemberName=".ctor">
|
|
<MemberSignature Language="C#" Value="public DrawingArea ();" />
|
|
<MemberType>Constructor</MemberType>
|
|
<ReturnValue />
|
|
<Parameters />
|
|
<Docs>
|
|
<summary>Default Constructor.</summary>
|
|
<returns>An instance of <see cref="T:Gtk.DrawingArea" />.</returns>
|
|
<remarks />
|
|
</Docs>
|
|
</Member>
|
|
<Member MemberName="GType">
|
|
<MemberSignature Language="C#" Value="public static GLib.GType GType { get; };" />
|
|
<MemberType>Property</MemberType>
|
|
<ReturnValue>
|
|
<ReturnType>GLib.GType</ReturnType>
|
|
</ReturnValue>
|
|
<Parameters />
|
|
<Docs>
|
|
<summary>GType Property.</summary>
|
|
<returns>a <see cref="T:GLib.GType" /></returns>
|
|
<remarks>Returns the native <see cref="T:GLib.GType" /> value for <see cref="T:Gtk.DrawingArea" />.</remarks>
|
|
</Docs>
|
|
</Member>
|
|
<Member MemberName=".ctor">
|
|
<MemberSignature Language="C#" Value="protected DrawingArea (GLib.GType gtype);" />
|
|
<MemberType>Constructor</MemberType>
|
|
<ReturnValue />
|
|
<Parameters>
|
|
<Parameter Name="gtype" Type="GLib.GType" />
|
|
</Parameters>
|
|
<Docs>
|
|
<summary>Protected Constructor.</summary>
|
|
<param name="gtype">a <see cref="T:GLib.GType" /></param>
|
|
<returns>a <see cref="T:Gtk.DrawingArea" /></returns>
|
|
<remarks>Chain to this constructor if you have manually registered a native <see cref="T:GLib.GType" /> value for your subclass.</remarks>
|
|
</Docs>
|
|
</Member>
|
|
</Members>
|
|
</Type>
|