- Posts: 1
- Thank you received: 0
×
Modelio 4.0.0 released (07 Nov 2019)
Modelio 4.0.0 has been released ( www.modelio.org/forum/4-announcements/45...-4-0-0-released.html )
issues with export-diagrams script
- patrickgeremia
-
Topic Author
- Offline
- Fresh Boarder
-
Less More
7 years 1 month ago #3515 by patrickgeremia
I have some issues with the export diagram scripts that I use with modelio 2.2.2.
For reference, the script can be found here: www.modeliosoft.com/en/modelio-store/scr...export-diagrams.html
I get the following error in the script window:
AttributeError: 'NoneType' object has no attribute 'getBounds' in at line number 281
Traceback (most recent call last):
File "", line 281, in
File "", line 140, in __init__
AttributeError: 'NoneType' object has no attribute 'getBounds'
I already checked that the following lines returns "active shell found"
from org.eclipse.swt.widgets import Display
For reference, the script can be found here: www.modeliosoft.com/en/modelio-store/scr...export-diagrams.html
I get the following error in the script window:
AttributeError: 'NoneType' object has no attribute 'getBounds' in at line number 281
Traceback (most recent call last):
File "", line 281, in
File "", line 140, in __init__
AttributeError: 'NoneType' object has no attribute 'getBounds'
I already checked that the following lines returns "active shell found"
from org.eclipse.swt.widgets import Display
parent = Display.getDefault().getActiveShell( )
if parent is None:
print "Active shell not found."
else:
print "Active shell found."
Please Log in or Create an account to join the conversation.
7 years 1 month ago #3516 by pan
Hi patrickgeremia,
This is a Hello world script for testing SWT on Modelio:
Can you run it and say us what is the result?
This is a Hello world script for testing SWT on Modelio:
from org.eclipse.swt import SWT
from org.eclipse.swt.widgets import Display
from org.eclipse.swt.widgets import Shell
from org.eclipse.swt.widgets import Text
class openwindow:
def __init__(self):
parent = Display.getDefault().getActiveShell()
child = Shell(parent, SWT.CLOSE | SWT.RESIZE)
parentW = parent.getBounds().width
parentH = parent.getBounds().height
print "Parent width: " + str(parentW)
print "Parent height: " + str(parentH)
helloWorldTest = Text(child, SWT.NONE)
helloWorldTest.setText("Hello World SWT")
helloWorldTest.pack()
child.pack()
child.open()
openwindow()
Can you run it and say us what is the result?
Please Log in or Create an account to join the conversation.
Time to create page: 0.034 seconds