Re: Python-Scripting in Dia
- From: Hans Breuer <hans breuer org>
- To: discussions about usage and development of dia <dia-list gnome org>
- Subject: Re: Python-Scripting in Dia
- Date: Tue, 03 Aug 2010 14:27:47 +0200
At 02.08.2010 23:13, Florian Sittel wrote:
If it is just creating objects via the python interface you should find
I am building an application for storing data as semantic network.
I would like to use Dia as of front-end.
(ie, a gui for a semantic database)
For that purpose, I wanted to write a python script that asks the
backend for data and creates a diagram representing the network.
Unfortunately, after hours of searching,
documentation/faq/mailing-list-archive reading I couldnt find a way, how
to create diagram objects via the python interface.
obj, h1, h2 = dia.get_object_type(oname).create (0, 0)
in every other PyDia sample. It is also kind of documnted in
I know, how to get information from the diagram, but not how to add new
objects (like a flowchart-box, etc).
obj, h1, h2 = dia.get_object_type ("Flowchart - Box").create (0, 0)
Maybe I'm too ;) At first I thought you wanted to implement Dia object
types in Python. That indeed is not possible at the moment. And doing so
would probably require to restructure a lot of the object interface and
related objects, because an object's implmentation has to maintain a lot of
internal state in 'public' variables, e.g. Object::position,
perhaps I am blind...
With a Python-enabled Dia you should take a closer look into the help menu.
There are some diagrams and html created to help developing with PyDia.
If so, I'd appreciate some help / information on how to do this.
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it. -- Dilbert
] [Thread Prev