March 2014 update

This commit is contained in:
Ingy döt Net 2014-04-02 16:56:35 +00:00
parent 09687c4926
commit a25938f123
1846 changed files with 21876 additions and 5203 deletions

View file

@ -3,24 +3,20 @@ package main
import (
"code.google.com/p/x-go-binding/ui"
"code.google.com/p/x-go-binding/ui/x11"
"fmt"
"os"
"log"
)
func main() {
win, err := x11.NewWindow()
if err != nil {
fmt.Printf("Error: %v\n", err)
os.Exit(1)
log.Fatalf("Error: %v\n", err)
}
defer win.Close()
evchan := win.EventChan()
for ev := range evchan {
for ev := range win.EventChan() {
switch e := ev.(type) {
case ui.ErrEvent:
fmt.Printf("Error: %v\n", e.Err)
os.Exit(1)
log.Fatalf("Error: %v\n", e.Err)
}
}
}

View file

@ -0,0 +1,8 @@
import javax.swing.JFrame
fun main(args : Array<String>) {
val w = JFrame("Title")
w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
w.setSize(800, 600)
w.setVisible(true)
}

View file

@ -12,24 +12,18 @@
@implementation Win : NSWindow
-(id) init
{
[self
if ((self = [super
initWithContentRect: NSMakeRect(0, 0, 800, 600)
styleMask: (NSTitledWindowMask | NSClosableWindowMask)
backing: NSBackingStoreBuffered
defer: NO];
[self setTitle: @"A Window"];
[self center];
defer: NO])) {
[self setTitle: @"A Window"];
[self center];
}
return self;
}
-(void) dealloc
{
[super dealloc];
}
- (void)applicationDidFinishLaunching: (NSNotification *)notification
{
[self orderFront: self];
@ -43,13 +37,13 @@
int main()
{
Win *mywin;
NSAutoreleasePool *pool;
@autoreleasepool {
pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
mywin = [[Win alloc] init];
[NSApp setDelegate: mywin];
[NSApp runModalForWindow: mywin];
[NSApplication sharedApplication];
Win *mywin = [[Win alloc] init];
[NSApp setDelegate: mywin];
[NSApp runModalForWindow: mywin];
}
return EXIT_SUCCESS;
}