Example: /Mac64bit/WebKit2/WebView Resources

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Mac64bit/WebKit2/WebView Resources


Required plugins for this example: MBS MacBase Plugin, MBS Mac64bit Plugin, MBS Main Plugin, MBS MacCocoa Plugin, MBS MacControls Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Mac64bit/WebKit2/WebView Resources

This example is the version from Wed, 28th Jun 2022.

Project "WebView Resources.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() End EventHandler
End Class
Class MainWindow Inherits Window
Control browser Inherits WKWebViewControlMBS
ControlInstance browser Inherits WKWebViewControlMBS
EventHandler Sub Open() Me.LoadURL "https://www.mbs-plugins.de" End EventHandler
EventHandler Sub decidePolicyForNavigationAction(navigationAction as WKNavigationActionMBS, decisionHandler as WKPolicyForNavigationActionDecisionHandlerMBS) List.AddRow navigationAction.request.URL // allow. decisionHandler.Allow End EventHandler
EventHandler Sub decidePolicyForNavigationResponse(navigationResponse as WKNavigationResponseMBS, decisionHandler as WKPolicyForNavigationResponseDecisionHandlerMBS) Dim response As NSURLResponseMBS = navigationResponse.response List.AddRow response.URL, If(navigationResponse.isForMainFrame, "yes", "no"), response.MIMEType, response.suggestedFilename // allow. decisionHandler.Allow End EventHandler
End Control
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() #If Target64Bit Then Title = "WebKit 2 with 64-bit" #else Title = "WebKit 1 with 32-bit" #endif End EventHandler
Function FindFile(name as string) As FolderItem // Look for file in parent folders from executable on dim parent as FolderItem = app.ExecutableFile.Parent while parent<>Nil dim file as FolderItem = parent.Child(name) if file<>Nil and file.Exists then Return file end if parent = parent.Parent wend End Function
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

The items on this page are in the following plugins: MBS Mac64bit Plugin.


💬 Ask a question or report a problem