#import "SimpleBrowserController.h"

@implementation SimpleBrowserController

- (void) resetButtons {	
	[backButton setEnabled:[myWebView canGoBack]];
	[forwardButton setEnabled:[myWebView canGoForward]];
}

-(IBAction) loadPreviousPage:(id) sender {
	[myWebView goBack];
	[self resetButtons];
}

-(IBAction) loadNextPage:(id) sender {
	[myWebView goForward];
	[self resetButtons];
}

-(IBAction) loadURLFrom: (id) sender {
	[myWebView takeStringURLFrom:sender];
	[self resetButtons];
}
//START:code.delegates.title
- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title 
	   forFrame:(WebFrame *)frame {	
	[[sender window] setTitle:title];
}
//END:code.delegates.title
@end
