Platforms to show: All Mac Windows Linux Cross-Platform
/Linux/Linux HTMLViewer with Webkit
Required plugins for this example: MBS Linux Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Linux/Linux HTMLViewer with Webkit
This example is the version from Tue, 20th Aug 2012.
Project "Linux HTMLViewer with Webkit.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control web Inherits HTMLViewer
ControlInstance web Inherits HTMLViewer
End Control
Control BackButton Inherits BevelButton
ControlInstance BackButton Inherits BevelButton
EventHandler Sub Action()
b.GoBack
End EventHandler
End Control
Control ForwardButton Inherits BevelButton
ControlInstance ForwardButton Inherits BevelButton
EventHandler Sub Action()
b.GoForward
End EventHandler
End Control
Control ProgressWheel1 Inherits ProgressWheel
ControlInstance ProgressWheel1 Inherits ProgressWheel
End Control
Control URL Inherits TextField
ControlInstance URL Inherits TextField
EventHandler Function KeyDown(Key As String) As Boolean
if asc(key) = 3 or asc(key) = 13 then
go
Return true
end if
End EventHandler
End Control
Control GoButton Inherits BevelButton
ControlInstance GoButton Inherits BevelButton
EventHandler Sub Action()
go
End EventHandler
End Control
Control Timer1 Inherits Timer
ControlInstance Timer1 Inherits Timer
EventHandler Sub Action()
if b = nil then Return
dim v as Boolean = b.CanGoBack
if v<>BackButton.Enabled then
BackButton.Enabled = v
end if
v = b.CanGoForward
if v<>ForwardButton.Enabled then
ForwardButton.Enabled = v
end if
dim LoadStatus as integer = b.LoadStatus
v = LoadStatus =1 or LoadStatus = 3
'Title = str(LoadStatus)
if v<>ProgressWheel1.Visible then
ProgressWheel1.Visible = v
end if
dim d as Double = b.Progress
dim n as integer = d * 100
if n<>MyProgressBar.Value then
MyProgressBar.Value = n
end if
End EventHandler
End Control
Control MyProgressBar Inherits ProgressBar
ControlInstance MyProgressBar Inherits ProgressBar
End Control
EventHandler Sub Open()
b = web.LinuxWebViewMBS
if b = nil then
MsgBox "Please make sure you have WebKit on Linux."
QUIT
end if
// test proxy
'b.proxyURL = "http://10.10.10.10/:1234"
'dim p as string = b.proxyURL
'MsgBox p
'
End EventHandler
Sub go()
dim u as string = url.Text
if instr(u,"://") = 0 then
u = "http://"+u
end if
web.LoadURL u
ProgressWheel1.Visible = true
End Sub
Property b As LinuxWebViewMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project
See also:
The items on this page are in the following plugins: MBS Linux Plugin.