Webkit References - Forward/Back Button

Hi Folks,

I am playing with the Webview (I have made a “browser”) - does anybody knows where to get a reference on which
commands can be used?



on clicked theObject
	if name of theObject is "go" then
		GetURL()
	end if
	
	if name of theObject is "bt_vor" then
		
	end if
	
	if name of theObject is "bt_back" then
		
	end if
	
end clicked

on end editing theObject
	GetURL()
end end editing

on launched theObject
	(*Add your script here.*)
end launched

on awake from nib theObject
	
end awake from nib

on GetURL()
	set tmpURL to contents of text field "URL" of window "main"
	try
		set URLWithString to call method "URLWithString:" of class "NSURL" with parameter tmpURL
		set requestWithURL to call method "requestWithURL:" of class "NSURLRequest" with parameter URLWithString
		set mainframe to call method "mainFrame" of object (view "browser" of window "main")
		call method "loadRequest:" of mainframe with parameter requestWithURL
	on error the_error
		log the_error
	end try
end GetURL


thanks for any Feedback…

Stefan

Hi Stefan,

you could have built your simple browser ‘codeless’ - only using Interface builder:
Try ctrl-dragging connections from a button or a text field to your web view and you’ll see:

goBack:
goForward:
takeTextURLFrom:
reload:
stopLoading:
etc …

D.

… I forgot:

of course you also can use code for this - for example in your script:

 
...  
   if name of theObject is "bt_back" then
	call method "goBack:" of (view "browser" of window "main")
   end if
...
   

A description of the WebView class should be on your hard disk:
file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/Reference/WebKit/ObjC_classic/Classes/WebView.html#//apple_ref/occ/cl/WebView
D.

Hi Dominik,

you are amazing! Thanks a lot!

Stefan

I’ve seen an article on this very topic, but now I can’t find it.

It’s also on the Apple’s site: http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/index.html?file:/Developer/ADC%20Reference%20Library/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html