[scribus] [scripter] Strange behavior of tkMessageBox.showerror()
Sam Qasbah
samqasbah at gmail.com
Tue Sep 7 22:02:33 CEST 2010
Hallo to all of you.
I use scribus 1.3.3.13svn on ubuntu 10.04.
This is a script that I wrote as an example of a procedure aimed to check
the systems requirements, and that causes the crash of scribus.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tkinter as tk
import tkMessageBox as tkmb
import sys
def main1():
errMsg = "This script requires Python v. 8.5 or later.\nYou are using
Python v. %s" % sys.version.split()[0]
print errMsg
root = tk.Tk() ### (1)
root.withdraw() ### (2)
tkmb.showerror('Python error', errMsg) ### (3)
sys.exit(1)
def main2():
errMsg = "This script requires Python v. 8.5 or later.\nYou are using
Python v. %s" % sys.version.split()[0]
print errMsg
tkmb.showerror('Python error', errMsg)
sys.exit(1)
if __name__ == '__main__':
# comment or uncomment to respectively test main1 OR main2
main1()
#main2()
in main1 the lines (1) and (2) are a trick to center the message box and to
not let appear the root window. main2 is the same function as main1 but
without the lines (1) and (2)
The problem is that, as in main1 as same in main2, when I run this script
scribus crashes, and it doesn't work any more. The messagebox remains on the
screen and nothing happens.
I tested the same script in the linux console and it works very well.
Where is the problem? Am I in fault or what else?
Sam Qasbah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20100907/ee64eaf8/attachment.htm>
More information about the scribus
mailing list