From 48eea29a81ed7fd12b4cdda63459bdd8bfcb5494 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sun, 11 Apr 2004 18:45:51 +0000 Subject: [PATCH] Contributions from psonek2@seznam.cz svn path=/trunk/gtk-sharp/; revision=25334 --- doc/en/Gnome/CanvasLine.xml | 40 ++++++++++++++++++++++++++++- doc/en/Gnome/CanvasPoints.xml | 48 ++++++++++++++++++++++++++++++++--- doc/en/Gnome/CanvasText.xml | 2 +- 3 files changed, 84 insertions(+), 6 deletions(-) diff --git a/doc/en/Gnome/CanvasLine.xml b/doc/en/Gnome/CanvasLine.xml index 731fdb15e..701d466e7 100644 --- a/doc/en/Gnome/CanvasLine.xml +++ b/doc/en/Gnome/CanvasLine.xml @@ -15,7 +15,45 @@ A canvas item for drawing lines. This canvas item uses a structure so one or multiple joined lined segments can be drawn with a single item. - + + + +// LineExample.cs - Displays triangle using gnome canvas +// Compile: mcs -r gtk-sharp.dll -r gnome-sharp.dll LineExample.cs + +namespace GnomeSamples { + + using System; + using Gtk; + using Gnome; + + public class LineExample { + + public static int Main (string[] args) { + Application.Init (); + + Gtk.Window win = new Gtk.Window ("Canvas line example"); + win.DeleteEvent += new DeleteEventHandler (Window_Delete); + + Canvas canvas = new Canvas (); + win.Add (canvas); + CanvasLine line = new CanvasLine (canvas.Root ()); + line.Points = new CanvasPoints (new double[]{40,0, 0,80, 80,80, 40,0}); + + win.ShowAll (); + Application.Run (); + return 0; + } + + static void Window_Delete (object obj, DeleteEventArgs args) { + Application.Quit (); + args.RetVal = true; + } + } +} + + + Gnome.CanvasItem diff --git a/doc/en/Gnome/CanvasPoints.xml b/doc/en/Gnome/CanvasPoints.xml index d6f35bf9c..07ac2fc63 100644 --- a/doc/en/Gnome/CanvasPoints.xml +++ b/doc/en/Gnome/CanvasPoints.xml @@ -10,7 +10,7 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added + A structure to manage an array of points (X and Y coordinates). To be added @@ -91,10 +91,50 @@ - To be added - a + Creates canvas points from x and y coordinates stored in array. + + array of coordinates (num_points * 2 in size), X coordinates are stored in the even-numbered indices, and Y coordinates are stored in the odd-numbered indices. a - To be added + + + +// LineExample.cs - Displays triangle using gnome canvas +// Compile: mcs -r gtk-sharp.dll -r gnome-sharp.dll LineExample.cs + +namespace GnomeSamples { + + using System; + using Gtk; + using Gnome; + + public class LineExample { + + public static int Main (string[] args) { + Application.Init (); + + Gtk.Window win = new Gtk.Window ("Canvas line example"); + win.DeleteEvent += new DeleteEventHandler (Window_Delete); + + Canvas canvas = new Canvas (); + win.Add (canvas); + CanvasLine line = new CanvasLine (canvas.Root ()); + line.Points = new CanvasPoints (new double[]{40,0, 0,80, 80,80, 40,0}); + + win.ShowAll (); + Application.Run (); + return 0; + } + + static void Window_Delete (object obj, DeleteEventArgs args) { + Application.Quit (); + args.RetVal = true; + } + } +} + + + + diff --git a/doc/en/Gnome/CanvasText.xml b/doc/en/Gnome/CanvasText.xml index 3980ec580..bef0212b1 100644 --- a/doc/en/Gnome/CanvasText.xml +++ b/doc/en/Gnome/CanvasText.xml @@ -10,7 +10,7 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added + Use this class to create text on the canvas. To be added