Re: Dia Python



On 15 Jan 2003, Lars Clausen wrote:

As can be seen from my TWiki comments, I have gotten the Python plugin to
work, and it's rather cute, in fact.  Now I've two fairly general
questions about it that I hope somebody here can answer (Hans? James?):

1)  How do I set a value in a property?  I tried with just 

              props[s].value = 0.2

    where s is a property key, but it gives me a type error.  Of course,
    DiaProperty.value is an object, but how do I make an object for a
    real?

2)  If I do changes values that way, will it be undoable?  I don't see a
    lot of undo-related stuff in the python plugin code, does that need
    to be rewritten?  I'd like to avoid the situation in Gimp where
    plugins can totally screw up undo.

Well, I found the answer to this one:  Not only isn't it undoable, but
connections aren't moved with it and the display isn't updated.
Unfortunately, the display update part is all in app, which we don't want
to link to from plug-ins.  If there's also a perl plugin coming up, we'll
need to encapsulate these things differently, so they behave the same
between main program and plugins.

-Lars

-- 
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause)| Hårdgrim of Numenor
"I do not agree with a word that you say, but I   |----------------------------
will defend to the death your right to say it."   | Where are we going, and
    --Evelyn Beatrice Hall paraphrasing Voltaire  | what's with the handbasket?



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