Unclosable message box

Previous topic - Next topic

PercyThePenguin

Now in some way ChatGPT is to blame here. (I'm just starting out, trying random examples.) It gave me this script. The problem is that when it is done, the message box appears with no close/ok button, and closing the window did nothing, so I had to kill scribus from the cli.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import scribus

def main():
    if not scribus.haveDoc():
        scribus.messageBox("Error", "Please open or create a document first.", icon=0, button1=1)
        return

    # Create a new master page named "TwoColumn"
    scribus.createMasterPage("TwoColumn")
    scribus.editMasterPage("TwoColumn")

    # Add vertical guides (left margin at 20mm, center, right margin at 190mm)
    scribus.setVGuides([20.0, 105.0, 190.0])   # units are in current document units (usually mm)

    # Add horizontal guides (top at 20mm, baseline at 50mm, bottom at 270mm)
    scribus.setHGuides([20.0, 50.0, 270.0])

    # Done editing master page
    scribus.closeMasterPage()

    scribus.messageBox("Done", "Master page 'TwoColumn' created with guides.", icon=0, button1=1)


if __name__ == "__main__":
    if scribus.haveDoc():
        main()


PercyThePenguin

The point I'm getting at is that this appears to put Scribus into an unusable state, with a modal dialog that you can't close (or which lacks an obvious way to close it).