added libhandy
This commit is contained in:
parent
bd54d37687
commit
adc5240aba
6 changed files with 45 additions and 10 deletions
14
README.adoc
14
README.adoc
|
|
@ -1,6 +1,6 @@
|
||||||
= High level GTK3 (and GTK4) bindings for the Nim programming language
|
= High level GTK3 (and GTK4) bindings for the Nim programming language
|
||||||
(c) Stefan Salewski
|
(c) Stefan Salewski
|
||||||
//Version 0.8.0
|
//Version 0.8.1
|
||||||
:experimental:
|
:experimental:
|
||||||
:imagesdir: http://ssalewski.de/tmp
|
:imagesdir: http://ssalewski.de/tmp
|
||||||
:source-highlighter: pygments
|
:source-highlighter: pygments
|
||||||
|
|
@ -25,12 +25,12 @@ with code inserted from files directly.
|
||||||
NOTE: This work is partly based on earlier works of J. Mansour and has been supported by A. Rumpf, E. Bassi and other _Nim_ and _GTK/Gnome_ developers.
|
NOTE: This work is partly based on earlier works of J. Mansour and has been supported by A. Rumpf, E. Bassi and other _Nim_ and _GTK/Gnome_ developers.
|
||||||
The `combinatorics` module was kindly provided by R. Behrends.
|
The `combinatorics` module was kindly provided by R. Behrends.
|
||||||
|
|
||||||
NOTE: We fixed a few small bugs in the last weeks, so we decided to finally make a 0.8.0 release.
|
NOTE: This is version 0.8.1 of gintro. Requested by FedericoCeratto we have added libhandy support.
|
||||||
The GTK4 examples from http://ssalewski.de/gtkprogramming.html
|
Libhandy is not yet available for GTK4 but seems to work with gtk+-3.24.20. As Gentoo Linux ships still
|
||||||
should work now, and the existing GTK3 examples seems still to work. This release is already available since a few weeks by
|
only a very old libhandy, we tested with latest release from https://gitlab.gnome.org/GNOME/libhandy/
|
||||||
*"nimble install gintro@#head"* command, so we assume that there are no serious issues.
|
Only available example is currently /examples/gtk3/handy.nim converted from example.py.
|
||||||
We have added a simple VTE example to the GTK3 example directory.
|
|
||||||
If you are using Arch Linux you may still have to ensure that
|
NOTE: If you are using Arch Linux you may still have to ensure that
|
||||||
curl or wget is available, see https://github.com/StefanSalewski/gintro/issues/83.
|
curl or wget is available, see https://github.com/StefanSalewski/gintro/issues/83.
|
||||||
Next release will get support for GList proc parameters and results, but providing that is some non trivial work
|
Next release will get support for GList proc parameters and results, but providing that is some non trivial work
|
||||||
and may break some other stuff unfortunately. Note that the File type of module gio is now called GFile to
|
and may break some other stuff unfortunately. Note that the File type of module gio is now called GFile to
|
||||||
|
|
|
||||||
31
examples/gtk3/handy.nim
Normal file
31
examples/gtk3/handy.nim
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# https://gitlab.gnome.org/GNOME/libhandy/-/blob/master/examples/example.py
|
||||||
|
# nim c --gc:arc handy.nim
|
||||||
|
import gintro/[gtk, gobject, handy]
|
||||||
|
|
||||||
|
proc main =
|
||||||
|
gtk.init()
|
||||||
|
handy.init()
|
||||||
|
let window = gtk.newWindow()
|
||||||
|
let vbox = newBox(Orientation.vertical, 0)
|
||||||
|
let entry = newEntry()
|
||||||
|
let keypad = handy.newKeypad(symbolsVisible = true, lettersVisible = true)
|
||||||
|
window.title = "Keypad Example with Nim"
|
||||||
|
vbox.add(entry) # widget to show dialed number
|
||||||
|
vbox.add(keypad)
|
||||||
|
vbox.setHalign(gtk.Align.center)
|
||||||
|
vbox.setValign(gtk.Align.center)
|
||||||
|
vbox.marginStart = 18
|
||||||
|
vbox.marginEnd = 18
|
||||||
|
vbox.marginTop = 18
|
||||||
|
vbox.marginBottom = 18
|
||||||
|
vbox.spacing = 18
|
||||||
|
keypad.setRowSpacing(6)
|
||||||
|
keypad.setColumnSpacing(6)
|
||||||
|
keypad.setEntry(entry) # attach the entry widget
|
||||||
|
window.connect("destroy", gtk.mainQuit)
|
||||||
|
window.add(vbox)
|
||||||
|
window.showAll()
|
||||||
|
gtk.main()
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
@ -14,6 +14,7 @@ nim c gaction.nim
|
||||||
nim c gearsmenu.nim
|
nim c gearsmenu.nim
|
||||||
nim c gsettings.nim
|
nim c gsettings.nim
|
||||||
nim c gstBasicTutorial1.nim
|
nim c gstBasicTutorial1.nim
|
||||||
|
nim c handy.nim
|
||||||
nim c label.nim
|
nim c label.nim
|
||||||
nim c listview.nim
|
nim c listview.nim
|
||||||
nim c menubar.nim
|
nim c menubar.nim
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ nim c --gc:arc gaction.nim
|
||||||
nim c --gc:arc gearsmenu.nim
|
nim c --gc:arc gearsmenu.nim
|
||||||
nim c --gc:arc gsettings.nim
|
nim c --gc:arc gsettings.nim
|
||||||
nim c --gc:arc gstBasicTutorial1.nim
|
nim c --gc:arc gstBasicTutorial1.nim
|
||||||
|
nim c --gc:arc handy.nim
|
||||||
nim c --gc:arc label.nim
|
nim c --gc:arc label.nim
|
||||||
nim c --gc:arc listview.nim
|
nim c --gc:arc listview.nim
|
||||||
nim c --gc:arc menubar.nim
|
nim c --gc:arc menubar.nim
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.8.0"
|
version = "0.8.1"
|
||||||
author = "Stefan Salewski"
|
author = "Stefan Salewski"
|
||||||
description = "High level GObject-Introspection based GTK3/GTK4 bindings"
|
description = "High level GObject-Introspection based GTK3/GTK4 bindings"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
||||||
|
|
@ -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.8.0 2020-JUL-30
|
# v 0.8.1 2020-AUG-19
|
||||||
# (c) S. Salewski 2018
|
# (c) S. Salewski 2018
|
||||||
|
|
||||||
# https://wiki.gnome.org/Projects/GObjectIntrospection
|
# https://wiki.gnome.org/Projects/GObjectIntrospection
|
||||||
|
|
@ -2877,6 +2877,7 @@ proc launch() =
|
||||||
main("Vte")
|
main("Vte")
|
||||||
main("Notify")
|
main("Notify")
|
||||||
main("Gst")
|
main("Gst")
|
||||||
|
main("Handy")
|
||||||
main("cairo")
|
main("cairo")
|
||||||
else:
|
else:
|
||||||
echo "First we try generating bindings for GTK4, this may fail when GTK4 is not properly installed"
|
echo "First we try generating bindings for GTK4, this may fail when GTK4 is not properly installed"
|
||||||
|
|
@ -2904,6 +2905,7 @@ proc launch() =
|
||||||
# main("Vte") # not yet available for GTK4
|
# main("Vte") # not yet available for GTK4
|
||||||
main("Notify")
|
main("Notify")
|
||||||
main("Gst")
|
main("Gst")
|
||||||
|
# main("Handy") # not yet available for GTK4
|
||||||
main("cairo")
|
main("cairo")
|
||||||
|
|
||||||
if ISGTK3:
|
if ISGTK3:
|
||||||
|
|
@ -2922,4 +2924,4 @@ proc launch() =
|
||||||
supmod4.close
|
supmod4.close
|
||||||
|
|
||||||
launch()
|
launch()
|
||||||
# 2925 lines
|
# 2927 lines
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue