Jaidyn Ann
1704d392e8
This small example demonstrates defining and binding to your own subclass of a QT widget. |
||
---|---|---|
.. | ||
README.md | ||
goodbye-widgets.h | ||
goodbye-widgets.scm | ||
goodbye.egg | ||
goodbye.scm | ||
goodbye.ui | ||
main.cpp | ||
prototypes.h |
“Goodbye” example
This is a bare-minimum example egg that shows how one can define their own custom QT widgets and bind to their methods in a way compatible with qt-light.
It defines an OurButton
C++ class that is derived from
QPushButton
with one change:
It adds a SayGoodbye()
method that changes the button’s label to “Goodbye”.
We write a wrapper C-function gb_saygoodbye()
and bind this function into
our goodbye-widgets
module under the name gb:saygoodbye
. It is run on the
button (originally labelled “Quit” in the goodbye.ui
file), so changing its
text to “Goodbye”.