Search code examples
c#monodevelopclutter

How do I use Clutter in conjunction with C#?


I am desperately trying to make a very simple C# program utilizing clutter (In MonoDevelop IDE) to prove functionality but am unfamiliar with C# convention. Do I need to construct a clutter object to then reference it? Have I improperly declared it in my library? Should Clutter be my namespace rather than HelloWorld? Any help would be greatly appreciated.

using System;
using Clutter;

namespace HelloWorld {
    public class HelloWorld {
        public int Main () {            

            // Init declaration produces error: 
            // Expression denotes a 'type', where a 'method group' was expected
            Clutter.Init ();

            Stage stage = Stage.Default;
            stage.Color = new Clutter.Color (0, 0, 0, 255);
            stage.SetSize (512, 512);

            stage.Show ();

            // Main declaration produces error: 
            // Expression denotes a 'type', where a 'method group' was expected
            Clutter.Main ();

            return 0;
        }
    }
}

Solution

  • I assume that the Clutter is a class in the Clutter namespace

    using System;
    using Clutter;
    
    namespace HelloWorld {
        public class HelloWorld {
            public int Main () {            
    
                // Init declaration produces error: 
                // Expression denotes a 'type', where a 'method group' was expected
                Clutter c = new Clutter();
                c.Init();
    
                Stage stage = Stage.Default;
                stage.Color = new Clutter.Color (0, 0, 0, 255);
                stage.SetSize (512, 512);
    
                stage.Show();
    
                // Main declaration produces error: 
                // Expression denotes a 'type', where a 'method group' was expected
                c.Main();
    
                return 0;
            }
        }
    }