mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding python bindings base
This commit is contained in:
18
example/main.py
git.filemode.normal_file
18
example/main.py
git.filemode.normal_file
@@ -0,0 +1,18 @@
|
||||
import macrolibpy as mlpy
|
||||
|
||||
if __name__ == '__main__':
|
||||
mlx = mlpy.Context.create()
|
||||
win = mlx.new_window(800, 600, "MacroLibX window")
|
||||
|
||||
def onevent(ev):
|
||||
if ev == 0:
|
||||
mlx.loop_end()
|
||||
|
||||
def onupdate():
|
||||
for x in range(0, 50):
|
||||
for y in range(0, 50):
|
||||
win.pixel_put(100 + x, 100 + y, 0xff0000ff)
|
||||
|
||||
win.on_event(mlpy.EventType.WINDOW_EVENT, onevent)
|
||||
mlx.add_loop_hook(onupdate)
|
||||
mlx.loop()
|
||||
Reference in New Issue
Block a user