- Joined
- Sep 24, 2007
- Messages
- 1
- Reaction score
- 0
I'm trying to open web pages with WebView. I have no problems doing that. But when I try to open up WebView in Tab View, it doesn't work. I want to be able to open up multiple web pages and be able to go back and forth between them with tabs.
Here's what I have.
Because I've been able to get WebView to work when it's not in the NSTabView, and because I've been able to get NSTabView to work when I'm just working with something simple like Text Field boxes, I know my problem must have something to do with the way I'm referencing my WebView in the Tab View. I've tried everything, and suggestions?
Here's what I have.
Code:
on clicked theObject
GetURL()
end clicked
on end editing theObject
GetURL()
end end editing
on GetURL()
tell tab view 1 of window 1
set theURL to "http://www.google.com" as text
try
set newString to (call method "stringByAddingPercentEscapesUsingEncoding:" of theURL with parameter 30)
set URLWithString to call method "URLWithString:" of class "NSURL" with parameter newString
set requestWithURL to call method "requestWithURL:" of class "NSURLRequest" with parameter URLWithString
set mainFrame to call method "mainFrame" of object (view "browser1" of tab view item "tab1")
call method "loadRequest:" of mainFrame with parameter requestWithURL
end try
end tell
end GetURL
Because I've been able to get WebView to work when it's not in the NSTabView, and because I've been able to get NSTabView to work when I'm just working with something simple like Text Field boxes, I know my problem must have something to do with the way I'm referencing my WebView in the Tab View. I've tried everything, and suggestions?