pyxforms/examples/demo1.py

35 lines
432 B
Python
Raw Normal View History

2024-05-31 21:13:07 +00:00
#!/usr/local/bin/python
2024-06-03 20:42:43 +00:00
from pyxforms import *
2024-05-31 21:13:07 +00:00
#
# Init the library (sucks but works)
#
2024-06-03 14:38:36 +00:00
xfinit("Something", "1", sys.argv[0])
2024-05-31 21:13:07 +00:00
#
# Create a "Window" - A form in XForms parlance
2024-06-03 14:38:36 +00:00
win = Form()
2024-05-31 21:13:07 +00:00
#
# Show it
win.Show()
#
# Create a button
2024-06-03 14:38:36 +00:00
a_button = Button(0, 10, 10, 100, 30, "Press Me")
2024-05-31 21:13:07 +00:00
#
# Put it inside win
2024-06-03 14:38:36 +00:00
win.Add(a_button)
2024-05-31 21:13:07 +00:00
#
# Start the event loop
# It will run forever, because the button doesn't do anything
2024-06-03 14:38:36 +00:00
runforms()