GTK# runs on mono on Windows.  I would like to know if it runs on mono on
Linux.

I have an app in VB.NET ported from gtk-sharp/sample/ButtonApp.cs
and it works on mono on windows using gtk#.  It was built using vs.net with
references to Mono's System and System.Drawing and gtk# assemblies.

It does not run on .NET though.
I cheated by running the .exe in my ~/mono/install/lib path which contains
all my mono assemblies, gtk# assemblies, gtk# glue, gtk+ and dependencies.

Two attached files:
The assembly is GtkSharpButtonTest_VBNet.exe
The source is Module1.vb

<<attachment: GtkSharpButtonTest_VBNet.exe>>

Imports GLib
Imports Gtk
Imports GtkSharp
Imports System
Imports System.Drawing

Public Class ButtonApp

    Sub New()
        Application.Init()
        Dim win As Gtk.Window
        win = New Window("Button Tester")
        win.DefaultSize = New Size(200, 150)
        Dim delete As DeleteEventHandler
        delete = New DeleteEventHandler(AddressOf Me.Window_Delete)

        AddHandler win.DeleteEvent, delete

        Dim btn As Button
        btn = New Button("Click Me")
        Dim btnClicked = New EventHandler(AddressOf Me.btn_click)
        AddHandler btn.Clicked, btnClicked

        win.Add(btn)
        win.ShowAll()
    End Sub

    Public Sub btn_click(ByVal obj As Object, ByVal args As EventArgs)
        Console.WriteLine("Button Clicked")
    End Sub

    Public Sub Window_Delete(ByVal obj As Object, ByVal args As DeleteEventArgs)
        Application.Quit()
        args.RetVal = True
    End Sub
End Class

Module Module1

    Sub Main()
        Application.Init()
        Dim buttonApp = New ButtonApp()
        Application.Run()
    End Sub

End Module

Reply via email to