[Gtk-sharp-list] System.Drawing
Philip Chapman
pac1085@rochester.rr.com
Tue, 13 May 2003 21:54:03 -0400
"Do I need to -r the reference?"
Yes, -r System.Drawing.dll
Philip
On Tue, 13 May 2003 21:46:41 -0400
"Christopher T. Miller" <christopher@ctmiller.net> wrote:
> Evening, all...
>=20
> Quick question...I'm just putzing around with some of the GtkSharp
> tutorials on
> http://go-mono.com/tutorial/html/en/gnome/bindings/gtk-sharp/misclabels.h=
tml, and I attempted to run compile the code below. Everything was fine, s=
ave that the compiler said that System.Drawing could not be found. Is it i=
n a separate *.dll from the main class library? Do I need to -r the refere=
nce?
>=20
> Thanks again,
> -Chris Miller
>=20
>=20
>=20
> // label.cs - Gtk# Tutorial example
> //
> // Author: Alejandro S=C3=A1nchez Acosta &li;raciel@es.gnu.org>
> // Cesar Octavio Lopez Nataren &li;cesar@ciencias.unam.mx>
> //
> // (c) 2002 Alejandro S=C3=A1nchez Acosta
>=20
> namespace GtkSharpTutorial {
>=20
> using Gtk;
> using GtkSharp;
> using System;
> using System.Drawing;
>=20
> public class label
> {
>=20
> static void delete_event (object obj, DeleteEventArgs arg=
s)
> {
> Application.Quit();
> }
>=20
> static void exitbutton_event (object obj, EventArgs args)
> {
> Application.Quit();
> }
>=20
> public static void Main (string[] args)
> {
> =20
> Widget widget;
> Window window;
> HBox hbox;
> VBox vbox;
> Frame frame;
> Label label;
> =20
> Application.Init (); =20
> =20
> =20
> window =3D new Window ("Label sample");
> =20
> window.DeleteEvent +=3D new DeleteEventHandler (d=
elete_event);
>=20
> window.Title =3D "Label";
> =20
> hbox =3D new HBox (false, 5);
> vbox =3D new VBox (false, 5);
>=20
> window.Add (hbox);
> hbox.PackStart (vbox, false, false, 0);
>=20
> window.BorderWidth =3D 5;
>=20
> frame =3D new Frame ("Normal Label");
> label =3D new Label ("This is a normal label");
> =20
> frame.Add (label);
> vbox.PackStart (frame, false, false, 0);
> =20
> frame =3D new Frame ("Multiline Label");
> label =3D new Label ("This is a Multi-line label\=
nSecond Line\nThird Line");
> =20
> frame.Add (label);
> vbox.PackStart (frame, false, false, 0);
> =20
> frame =3D new Frame ("Left Justified Label");
> label =3D new Label ("This is a Left-Justified\n"=
+ "Multi-line label.\n" + "Third line");
> label.Justify =3D Justification.Left;
>=20
> frame.Add (label);
> vbox.PackStart (frame, false, false, 0);
> =20
> frame =3D new Frame ("Right Justified Label"); =
=20
> label =3D new Label ("This is a Right Justified\n=
Multi-line label.\n" + "Fourth Line, (j/k)");
> label.Justify =3D Justification.Right;
> frame.Add (label);
> vbox.PackStart (frame, false, false, 0);
>=20
> vbox =3D new VBox (false, 5);
> hbox.PackStart(vbox, false, false, 0);
> =20
> frame =3D new Frame ("Line wrapped Label");
> label =3D new Label ("This is an example of a lin=
e-wrapped label. It " +
> "should not be taking up the entire =
" /* big space to test spacing */ +
> "width allocated to it, but automatically " +
> "wraps the words to fit. " +
> "The time has come, for all good men, to come to=
" +
> "the aid of their party. " +
> "The sixth sheik's six sheep's sick.\n" +
> " It supports multiple paragraphs correctly,=
" +
> "and correctly adds " +
> "many extra spaces. ");
> =20
> label.LineWrap =3D true;
> =20
> frame.Add (label);
> vbox.PackStart(frame, false, false, 0);
> =20
> frame =3D new Frame ("Filled wrapped label");
> label =3D new Label ("This is an example of a lin=
e-wrapped, filled label. " +
> "It should be taking " +
> "up the entire width allocated to i=
t. " +
> "Here is a sentence to prove " +
> "my point. Here is another sentence. " +
> "Here comes the sun, do de do de do.\n" +
> " This is a new paragraph.\n" +
> " This is another newer, longer, better " +
> "paragraph. It is coming to an end, "+
> "unfortunately.");
> =20
> label.Justify =3D Justification.Fill;
> label.Wrap =3D true;
> frame.Add (label);
> vbox.PackStart (frame, false, false, 0);
>=20
>=20
> frame =3D new Frame ("Underlined label");
> =20
> label =3D new Label ("This label is underlined!\n=
" + "This one is underlined in quite a funky fastion");
>=20
> label.Justify =3D Justification.Left;
> label.Pattern =3D "_________________________ _ __=
_______ _ ______ __ _______ ___";
>=20
> frame.Add (label);
> vbox.PackStart (frame, false, false, 0);
>=20
> window.ShowAll ();
>=20
> Application.Run ();
> }
> }
> }
>=20
>=20
>=20
>=20
> _______________________________________________
> Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list