"""
To compile:
cobra -c -t:winexe -r:System.Windows.Forms 380-WinForms.cobra
To run:
winforms
Or leave out the "-c" to compile and run in one shot.
Recommended reading:
Programming Microsoft Windows Forms
by Charles Petzold
Cobra tips:
* Combine enums: AnchorStyle(Left, Right)
* Hook up events: listen someObj.someEvent, ref .myMethod
"""
use System.Windows.Forms
class MyForm
inherits Form
def init
.text = 'Click Me'
listen .click, ref .handleClick
def handleClick(sender as Object, args as EventArgs)
MessageBox.show('You clicked me!', 'Click')
class Program
def main is shared
Application.run(MyForm()) |