Guest User

Untitled

a guest
Feb 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. import <Foundation/CPObject.j>
  2. import <AppKit/CPPanel.j>
  3. import <AppKit/CPWindowController.j>
  4.  
  5. @implementation ColorWindow : CPWindowController
  6. {
  7. }
  8. - (id)init
  9. {
  10. var hud = [[CPPanel alloc]
  11. initWithContentRect:CGRectMake(100,100,225,125)
  12. styleMask: nil];
  13. self = [super initWithWindow:hud];
  14. if (self)
  15. {
  16. [hud setFloatingPanel:YES];
  17. [hud orderFront:self];
  18. var cv = [[self window] contentView];
  19. [cv setBackgroundColor:[CPColor whiteColor]];
  20. }
  21. return self;
  22. }
  23. - (void)setBackgroundColor:(CPColor)color
  24. {
  25. var cv = [[self window] contentView];
  26. [cv setBackgroundColor:color];
  27. }
  28. @end
  29.  
  30. @implementation AppController : CPObject
  31. {
  32. }
  33.  
  34. - (void)applicationDidFinishLaunching:(CPNotification)aNotification
  35. {
  36. var win = [[CPWindow alloc]
  37. initWithContentRect:CGRectMakeZero()
  38. styleMask:CPBorderlessBridgeWindowMask];
  39. contentView = [win contentView];
  40. [win orderFront:self];
  41. [contentView setBackgroundColor:[CPColor blackColor]];
  42. var lwin = [[ColorWindow alloc] init];
  43. [lwin showWindow:self];
  44. [lwin setBackgroundColor:blueColor];
  45. }
  46.  
  47. @end
Add Comment
Please, Sign In to add comment