mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
skeleton for cocoa standalone tester
This commit is contained in:
parent
a53b99b307
commit
9f9ef1b180
6 changed files with 143 additions and 0 deletions
42
cocoatea/cocoatea.mm
Normal file
42
cocoatea/cocoatea.mm
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* -*- c++ -*- */
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include "view.h"
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char* argv[])
|
||||
{
|
||||
NSRect rect = NSMakeRect (100, 100, 500, 500);
|
||||
NSRect frameRect = NSMakeRect (10, 10, 480, 480);
|
||||
|
||||
NSWindow* win = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:NSBorderlessWindowMask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
|
||||
CTView* view = [[CTView alloc] initWithFrame:frameRect];
|
||||
|
||||
[win setContentView:view];
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps : YES ];
|
||||
[win makeKeyAndOrderFront:win];
|
||||
|
||||
NSRunLoop *runloop = [NSRunLoop currentRunLoop];
|
||||
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:view selector:@selector(timedUpdate) userInfo:nil repeats:YES];
|
||||
|
||||
[[NSApplication sharedApplication] run];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
1, derive a new View type that will have our drawing methods
|
||||
2. add time to the run loop to trigger redraws
|
||||
|
||||
figure out how to draw
|
||||
|
||||
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue