| Revision 1,
526 bytes
checked in by tal, 6 years ago
(diff) |
|
initial import
|
| Line | |
|---|
| 1 | from AppKit import * |
|---|
| 2 | from PyObjCTools import AppHelper |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | class _VanillaMiniAppDelegate(NSObject): |
|---|
| 6 | |
|---|
| 7 | def applicationShouldTerminateAfterLastWindowClosed_(self, notification): |
|---|
| 8 | return True |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | def executeVanillaTest(cls, **kwargs): |
|---|
| 12 | """ |
|---|
| 13 | Execute a Vanilla UI class in a mini application. |
|---|
| 14 | """ |
|---|
| 15 | app = NSApplication.sharedApplication() |
|---|
| 16 | delegate = _VanillaMiniAppDelegate.alloc().init() |
|---|
| 17 | app.setDelegate_(delegate) |
|---|
| 18 | cls(**kwargs) |
|---|
| 19 | app.activateIgnoringOtherApps_(True) |
|---|
| 20 | AppHelper.runEventLoop() |
|---|
| 21 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.