[Mono-list] gtk# problem

Paul paul@all-the-johnsons.co.uk
Wed, 07 Jul 2004 22:24:00 +0000


--=-xPqXFJvF+lSQXlS9UGjk
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi,

Below is a very simple piece of code which I'm still trying to compile -
but all I get is an error (error CS0029: Cannot convert implicitly from
`System.Drawing.Size' to `Gdk.Size').

How do I fix this problem?

TTFN

Paul

8---->

using Gtk;
using GtkSharp;
using System;
using System.Drawing

public class MyButton
{
  public static void Main(string [] args)
  {
     Application.Init();
     Window win =3D new Window("My first button");
     win.DefaultSize =3D new Size(200, 200);
     Button btn =3D new Button("Click");
     win.Add(btn);
     win.ShowAll();
     Application.Run();
   }
}

mcs gtksharp.cs -r System.Drawing -pkg:gtk-sharp
gtksharp.cs(11) error CS0029: Cannot convert implicitly from `System.
Drawing.Size' to `Gdk.Size'
Compilation failed: 1 error, 0 warnings

--=-xPqXFJvF+lSQXlS9UGjk
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBA7HgAIX4V53EitUoRAm4OAJ9exT04T22yFJ5JJn4eFDYrQX7O+QCgpDn2
Dfy5ydDQEfKkrJcAQfdnuQM=
=vnmK
-----END PGP SIGNATURE-----

--=-xPqXFJvF+lSQXlS9UGjk--