Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Excerpt

How many ways can you say Hello World?

This example shows console, WinForms and Gtk versions of "Hello, world!".

Console

Code Block
print "Hello, world!"

WinForms

Code Block
import System.Windows.Forms

f = Form(Text: "Hello, boo!")
f.Controls.Add(Button(Text: "Click Me!", Dock: DockStyle.Fill))

Application.Run(f)

Gtk#

Code Block
import Gtk from "gtk-sharp"

Application.Init()

window = Window("Hello, boo!",
                DefaultWidth:  200,
                DefaultHeight: 150)

# The application should exit after the window is closed
window.DeleteEvent += def():
    Application.Quit ()

window.Add(Button("Click Me!"))
window.ShowAll()
Application.Run()