I'm working on a set of scripts to layout construction drawings for architecture & engineering in Scribus. Right now, I am working on title block functionality. Information is either set page-by-page, or applies to the whole set. Information that applies to the whole set is put on the Master page.
I've gotten everything to work, except text frames that I create on the Master don't show up until the document is closed and reopened, or the Master page is edited. Is there a way to tell Scribus to refresh the master page layers when in normal view? The normal redraw toggling seems to not help.
I've prepared a small script that demonstrates this behavior. Open a blank document and run the script, it will look as if the document is unchanged. If you edit the master page, you will see the "Hello from the Master Page!" text in the upper-left corner. If you then go back to the normal page, you will see the text.
Scribus crashes, sometimes, when leaving the master page editing session.
At work, I'm using Windows 7 and Scribus 1.4.1
At home, I'm using Kubuntu 12.04 and Scribus 1.4.0 and the development PPA.
Let me know if additional information will help, or if I should file this as a bug.
Here's the test code:
import sys
try:
import scribus
except ImportError,err:
print "This script must be run within Scribus."
sys.exit(1)
def main(argv):
"""
Test function: Master pages not redrawn after the following changes.
"""
try:
scribus.editMasterPage(scribus.masterPageNames()[0])
w, h = scribus.getPageSize()
scribus.createText(0.0,0.0,w,h,'test_frame')
scribus.setText('Hello from the Master Page!','test_frame')
finally:
scribus.closeMasterPage()
def main_wrapper(argv):
""" Boiler plate from /share/samples/boilerplate.py """
try:
scribus.statusMessage("Running script...")
scribus.progressReset()
main(argv)
finally:
if scribus.haveDoc():
scribus.setRedraw(True)
scribus.statusMessage("")
scribus.progressReset()
if __name__ == '__main__':
main_wrapper(sys.argv)