Re: Working it out...



On 24.03.2006 18:11, Athanasios Anastasiou wrote:
Hello Guys

Sorry to be a nuisance with "simple" questions but is it possible to provide some hint on the following?

1)
I have been looking at the Dia source code to find out some more info on how to add some properties to a graph in the way it shows up in UML. I took a look at the shapes related files and the properties related files but it seems like the shapes are very abstracted. Could you provide some insight? I suppose that there are "hooks" on things like "Show me the properties" where Dia calls a supplied function instead of its default one for properties. Something similar must be happening with the objects them selfs to provide the extra properties and stuff. Otherwise i would have to recompile Dia everytime i would like to add a new set of symbols. Any direction is greatly appreciated.

Start reading in lib/object.h
The concrete function (pointer) you are looking for is
GetPropertiesFunc which is implemented for UML as
umlclass_get_properties

Every DiaObject has a factory DiaObjectType e.g. to create, load, save
the object; see _ObjectTypeOps.

And there is also for every object an interface definition (_ObjectOps)
which allows object (class) specific implementations. GetPropertiesFunc
is a function pointer in this structure.

2)
Is there a way to completely reload a package in Python? I hate to restart Dia everytime i am making a change to my script.

I have experimented with that but did not find a way. The idea
was a proxy object which does 'import' and 'delete' on the real implementation.


3)
How does the dia.register_* family of functions works? (From within Python that is) I mean, i am assigning a function to a particular menu item but it does not appear there :-/ am i missing something there?

This is only working for the 'old' menu, not for the 'diagram menubar',
see http://bugzilla.gnome.org/show_bug.cgi?id=171397

        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]