tiny fixes for VTE
This commit is contained in:
parent
0f492ed6b5
commit
5df6e084e1
4 changed files with 26 additions and 5 deletions
|
|
@ -21,4 +21,4 @@ nim c overlay_tree1.nim
|
||||||
nim c simpledrawingarea.nim
|
nim c simpledrawingarea.nim
|
||||||
nim c sourceview_test.nim
|
nim c sourceview_test.nim
|
||||||
nim c t0.nim
|
nim c t0.nim
|
||||||
|
nim c vte.nim
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,4 @@ nim c --gc:arc overlay_tree1.nim
|
||||||
nim c --gc:arc simpledrawingarea.nim
|
nim c --gc:arc simpledrawingarea.nim
|
||||||
nim c --gc:arc sourceview_test.nim
|
nim c --gc:arc sourceview_test.nim
|
||||||
nim c --gc:arc t0.nim
|
nim c --gc:arc t0.nim
|
||||||
|
nim c --gc:arc vte.nim
|
||||||
|
|
|
||||||
21
examples/gtk3/vte.nim
Normal file
21
examples/gtk3/vte.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# https://vincent.bernat.im/en/blog/2017-write-own-terminal
|
||||||
|
import gintro/[gtk, glib, gobject, gio, vte]
|
||||||
|
|
||||||
|
proc appActivate(app: Application) =
|
||||||
|
let window = newApplicationWindow(app)
|
||||||
|
window.title = "GTK3 & Nim"
|
||||||
|
window.defaultSize = (600, 200)
|
||||||
|
let terminal = newTerminal()
|
||||||
|
let environ = getEnviron()
|
||||||
|
let command = environ.environGetenv("SHELL")
|
||||||
|
var pid = 0
|
||||||
|
echo terminal.spawnSync({}, nil, [command], [], {SpawnFlag.leaveDescriptorsOpen}, nil, nil, pid, nil)
|
||||||
|
window.add(terminal)
|
||||||
|
showAll(window)
|
||||||
|
|
||||||
|
proc main =
|
||||||
|
let app = newApplication("org.gtk.example")
|
||||||
|
connect(app, "activate", appActivate)
|
||||||
|
discard run(app)
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# High level gobject-introspection based GTK3/GTK4 bindings for the Nim programming language
|
# High level gobject-introspection based GTK3/GTK4 bindings for the Nim programming language
|
||||||
# nimpretty --maxLineLen:130 gen.nim
|
# nimpretty --maxLineLen:130 gen.nim
|
||||||
# v 0.7.9 2020-JUL-11
|
# v 0.7.9 2020-JUL-13
|
||||||
# (c) S. Salewski 2018
|
# (c) S. Salewski 2018
|
||||||
|
|
||||||
# https://wiki.gnome.org/Projects/GObjectIntrospection
|
# https://wiki.gnome.org/Projects/GObjectIntrospection
|
||||||
|
|
@ -69,7 +69,7 @@ const
|
||||||
NamedArrays = ["TargetEntry00Array", "PageRangeArray", "KeymapKeyArray"]
|
NamedArrays = ["TargetEntry00Array", "PageRangeArray", "KeymapKeyArray"]
|
||||||
#NamedArrayCandidates = NamedArrays.mapIt(it.replace("00Array").replace("Array"))
|
#NamedArrayCandidates = NamedArrays.mapIt(it.replace("00Array").replace("Array"))
|
||||||
StringArrayName = "fs469n23" # for seq -- cstringArray conversion
|
StringArrayName = "fs469n23" # for seq -- cstringArray conversion
|
||||||
StringArrayEntries = 16
|
StringArrayEntries = 256 # initial 16, but that was too small for VTE environGetenv(). Stack allocated pointer array -- replace by heap or global?
|
||||||
|
|
||||||
keywords = """
|
keywords = """
|
||||||
addr and as asm bind block break case cast concept const continue converter
|
addr and as asm bind block break case cast concept const continue converter
|
||||||
|
|
@ -2328,7 +2328,7 @@ proc main(namespace: string; version: cstring = nil) =
|
||||||
#output.writeLine("type\n int32Array* = pointer")
|
#output.writeLine("type\n int32Array* = pointer")
|
||||||
#output.writeLine("type\n PollFD00Array* = pointer")
|
#output.writeLine("type\n PollFD00Array* = pointer")
|
||||||
#output.writeLine("type\n Variant00Array* = pointer")
|
#output.writeLine("type\n Variant00Array* = pointer")
|
||||||
#output.writeLine("type\n Regex00Array* = pointer")
|
output.writeLine("type\n Regex00Array* = pointer")
|
||||||
#output.writeLine("type\n LogField00Array* = pointer")
|
#output.writeLine("type\n LogField00Array* = pointer")
|
||||||
#output.writeLine("type\n VariantType00Array* = pointer")
|
#output.writeLine("type\n VariantType00Array* = pointer")
|
||||||
#output.writeLine("type\n DebugKey00Array* = pointer")
|
#output.writeLine("type\n DebugKey00Array* = pointer")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue