Hello. I tried to make a program that outputs text to a console when a label
is clicked. It is as follows:

========================== code start

using System;
using Gtk;

class Test
{
    static void Main()
    {
        Application.Init();

        Window window = new Window("Test Window");
        window.Resize(200, 200);

        Label label = new Label("A label");
        label.ButtonPressEvent += ClickHandler;

        window.Add(label);
        window.ShowAll();

        Application.Run();
    }

    static void ClickHandler(object sender, EventArgs e)
    {
        Console.WriteLine("Hello!!!");
    }
}

========================== code end

It compiles successfully whether in .NET or Mono, however when run (whether
in .NET or Mono) nothing happens when I click the label. Can anyone help me?

System info: Windows 7 64 bit, Mono 2.6.7 + GTK# 2.12.10, .NET 4.0 + gtk#
2.12.10

Thanks.

Agro
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to