Let me start by saying that this is my first real Cocoa application. This is a simple application that pretty much displays my site in a borderless window. So as I create a borderless window, use the following:
- (void) awakeFromNib { [window setStyleMask:NSBorderlessWindowMask]; [window setAcceptsMouseMovedEvents:YES]; [window setMovableByWindowBackground:YES]; [window setLevel:NSNormalWindowLevel]; }
The problem is that as a result, the WebView inside the window does not skip the mouse over events on elements on the loaded page and does not provide the ability to enter text fields. I know that I have to create my own window instead and move the contents to it, but I'm too new to Objective-C to figure out how to do this.
I also tried declaring it all with no luck:
@implementation specikAppDelegate @synthesize window; @synthesize webView; - (BOOL) canBecomeKeyWindow { return YES; } - (BOOL) canBecomeMainWindow { return YES; } - (BOOL) acceptsFirstResponder { return YES; } - (BOOL) becomeFirstResponder { return YES; } - (BOOL) resignFirstResponder { return YES; } ... @end
In addition, I would like to be able to move the window by clicking and dragging it anywhere, but thought about it. I searched extensively on the Internet and cannot find a solution.
The contents of my .h file (just in case):
@interface specikAppDelegate : NSObject <NSApplicationDelegate> { IBOutlet NSWindow *window; IBOutlet WebView *webView; } @property (assign) IBOutlet NSWindow *window; @property (nonatomic, retain) IBOutlet WebView *webView; - (IBAction)openAboutPanel:(id)sender; @end
Any help would be appreciated, and as I said, I am a super newbie in the world of Objective-C and Cocoa, but I come from the background of PHP development.
source share