Python bindings for libui-ng using Cython.
Example
import pyui_ng as ui
def main():
app = ui.UI()
window = ui.Window('Window', 800, 600)
window.set_margined(True)
def close(win: ui.Window):
app.stop()
return 0
window.on_close(close)
window.show()
app.main()
main()
Callback method can't accept anonymous function
# this will not work
button = ui.Button("Click me")
button.on_click(lambda btn: print("hello"))
# this will work
button = ui.Button("Click me")
func = lambda btn: print("hello")
button.on_click(func)
Works only on Linux (for now)
- Unix: GTK+ 3.10 or newer
Clone pyui-ng with libui-ng
$ git clone --recurse-submodules 'https://github.com/Spad0n/pyui-ng'
Run this command
$ # this command will automatically build libui-ng in a static library before compiling Cython code
$ python setup.py install