gnome-sharp2.16.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.Text canvas itemA canvas item for displaying text. See for a more advanced text display and editing canvas item.
using System;
using Gtk;
using GtkSharp;
using Gnome;
class CanvasTest
{
public CanvasTest()
{
Application.Init();
Window window1 = new Window("Hello Canvas!");
window1.DeleteEvent += new DeleteEventHandler (delete_event);
Canvas canvas1 = Canvas.NewAa();
int Width = 100;
int Height = 100;
canvas1.SetScrollRegion(0, 0, Width, Height);
canvas1.WidthRequest = Width;
canvas1.HeightRequest = Height;
CanvasGroup root = canvas1.Root();
// Draw Background
CanvasRect background = new CanvasRect(root);
background.X1 = 0;
background.X2 = Width;
background.Y1 = 0;
background.Y2 = Height;
background.FillColor = "#ffffff";
background.Show();
// Here we go
CanvasText hello = new CanvasText(root);
hello.X = 40;
hello.Y = 10;
hello.FillColor = "#000000";
hello.Text = "Hello, Canvas!";
hello.Show();
canvas1.Show();
window1.Add(canvas1);
window1.ShowAll();
Application.Run();
}
public static void Main()
{
new CanvasTest();
}
void delete_event (object obj, DeleteEventArgs args)
{
Application.Quit ();
}
}
Gnome.CanvasItemConstructorInternal constructor
Pointer to the C object.
This is an internal constructor, and should not be used by user code.ConstructorTo be added
an object of type To be addedPropertySystem.StringPango marked up text to render.an object of type To be addedGLib.Property("markup")PropertySystem.BooleanWhether to strike through the text.an object of type To be addedGLib.Property("strikethrough")PropertySystem.Int32Offset of text above the baseline.an object of type This property specifies the offset of the text below the baseline if Rise is negative.GLib.Property("rise")PropertySystem.StringThe text to display.an object of type To be addedGLib.Property("text")PropertySystem.StringName of the font family.an object of type e.g. Sans, Helvetica, Times, MonospaceGLib.Property("family")PropertySystem.DoubleY coordinate of anchor point.an object of type To be addedGLib.Property("y")PropertySystem.DoubleX coordinate of anchor point.an object of type To be addedGLib.Property("x")PropertySystem.DoubleHeight of clip rectangle.an object of type To be addedGLib.Property("clip_height")PropertyPango.StretchPango stretch of font to use.an object of type To be addedGLib.Property("stretch")PropertyGtk.JustificationJustification for multiline text.an object of type To be addedGLib.Property("justification")PropertySystem.DoubleUsed to query the height of the rendered text.an object of type To be addedGLib.Property("text_height")PropertySystem.DoubleVertical offset distance from anchor position.an object of type 'double'To be addedGLib.Property("y_offset")PropertyGdk.DrawableStipple pattern for filling the text.an object of type To be addedGLib.Property("fill_stipple")PropertyGtk.AnchorTypeAnchor position for the text.an object of type To be addedGLib.Property("anchor")PropertySystem.DoubleSize (in points) of font.an object of type To be addedGLib.Property("size_points")PropertySystem.Int32Pango weight of font to use.an object of type To be addedGLib.Property("weight")PropertySystem.BooleanUse clipping rectangle?an object of type To be addedGLib.Property("clip")PropertyPango.AttrListReference to a Pango attribute list.an object of type To be addedGLib.Property("attributes")PropertyPango.UnderlinePango underline style for text.an object of type To be addedGLib.Property("underline")PropertySystem.DoubleSize of font, relative to default size.an object of type To be addedGLib.Property("scale")PropertySystem.UInt32RGBA value used for AA color an object of type The color should be specified in the format 0xRRGGBBAA (R: red, G: green, B: blue, A: alpha)GLib.Property("fill_color_rgba")PropertySystem.Int32Size (in pixels) of font.an object of type To be addedGLib.Property("size")PropertySystem.DoubleWidth of clip rectangle.an object of type To be addedGLib.Property("clip_width")PropertyPango.StylePango style of font to use. an object of type To be addedGLib.Property("style")PropertyPango.VariantPango variant of font to use.an object of type To be addedGLib.Property("variant")PropertyGdk.ColorAn allocated Gdk.Color specification for text.an object of type To be addedGLib.Property("fill_color_gdk")PropertyPango.FontDescriptionFont description as a Pango.FontDescription class.an object of type To be addedGLib.Property("font_desc")PropertySystem.StringFont description as a string.an object of type See for a description of the format of the string representation.GLib.Property("font")PropertySystem.DoubleUsed to query the width of the rendered text.an object of type 'double'To be addedGLib.Property("text_width")PropertySystem.DoubleHorizontal offset distance from anchor position.an object of type To be addedGLib.Property("x_offset")PropertySystem.StringX color specification for text.an object of type To be addedGLib.Property("fill_color")PropertyGLib.GTypeGType Property.a Returns the native value for .ConstructorProtected Constructor.
a Chain to this constructor if you have manually registered a native value for your subclass.System.ObsoleteConstructorTo be addedTo be added