webkitgtk support
This commit is contained in:
parent
ad70b68564
commit
fc520f71eb
4 changed files with 71 additions and 8 deletions
20
examples/gtk3/webkitgtk.nim
Normal file
20
examples/gtk3/webkitgtk.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# https://wiki.gnome.org/Projects/WebKitGtk/ProgrammingGuide/Tutorial
|
||||
# nim c --gc:arc webkitgtk.nim
|
||||
import gintro/[gtk, glib, gobject, gio, webkit2]
|
||||
|
||||
proc appActivate (app: Application) =
|
||||
let window = newApplicationWindow(app)
|
||||
window.title = "WebKitGtk"
|
||||
window.defaultSize = (800, 600)
|
||||
let view = newWebView()
|
||||
view.loadUri("https://nim-lang.org/")
|
||||
window.add(view)
|
||||
window.showAll
|
||||
|
||||
proc main =
|
||||
let app = newApplication("org.gtk.example")
|
||||
connect(app, "activate", appActivate)
|
||||
discard app.run
|
||||
|
||||
main()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue