[Mono-list] gtk# problem

John Luke jluke@users.sourceforge.net
Wed, 7 Jul 2004 18:34:13 -0400


That looks like an outdated example, can you tell us where it is so it
can be fixed?
just change
win.DefaultSize = new Size(200, 200);
to
win.SetDefaultSize (200, 200);


On Wed, 07 Jul 2004 22:24:00 +0000, Paul <paul@all-the-johnsons.co.uk> wrote:
> 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 = new Window("My first button");
>      win.DefaultSize = new Size(200, 200);
>      Button btn = 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
> 
> 
>