On Wed, Sep 14, 2016 at 7:06 PM, Chris George <[email protected]> wrote:
> This problem is not related to any plugin, just Leo.
>
> I placed this tutorial script into an @clean node and hit Ctrl-B to run
> it. Leo exited and closed the command prompt and didn't execute the script.
> Running the file from the command prompt with python3 executed it perfectly.
>
​Remember that Leo is itself a Qt application. The following works:
from leo.core.leoQt import QtWidgets
# Using the leoQt module allows
# the code to work on Qt 4 or 5.
app = g.app.gui.qtApp
# The already running Leo application.
w = QtWidgets.QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
w.show()
g.app.my_widgets = [w]
# Save a reference to w so it won't be
# garbage collected at the end of the script.
# sys.exit(app.exec_())
# This would kill Leo.
HTH.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.