From: Bernhard H. <bh...@in...> - 2002-04-03 19:51:23
|
Pieter Edelman <P.E...@gm...> writes: > On 30 Mar 2002, Bernhard Herzog wrote: > > > Pieter Edelman <P.E...@gm...> writes: > > > > > - If I change colors via "object.SetProperties", no changes are shown > > > until a manual "redraw" is issued. > > > > This is a limitation in 0.6 which more or less assumes that only > > selected objects change. You can force redrawing of some other object by > > adding its bounding rectangle to the list of rectangles to clear. [...] > Well, the script works on selected objects, and those are not redrawn > automatically. I haven't revealed the whole truth yet :). Sketch 0.6 also assumes that if there's no undo information during a transaction, then nothing has changed so nothing needs to be redrawn. > However, if I call document.SetProperties() instead of > object.SetPropeties(), they are redrawn. The difference between the two is that document.SetPropeties() sets the given properties on all currently selected objects while object.SetPropeties() only modifies object, regardless of whether it's selected or not. Furthermore, document.SetPropeties() also sets up its own transaction and handles all the undo stuff automatically. > I still have > a question, though; is there a way to make the scripts go in another menu > than the "Scripts" menu? In 0.6, no. It might be possible to do it if you know enough about Tk, Tkinter and how Sketch creates its menus, but I have never tried it. In Sketch 0.7 it's possible to put scripts anywhere in the menu and you can even redefine builtin commands. Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://www.mapit.de/ |