
Hi Max,
- How can I create a temporary canvas item to display a helper path having a given shape?
For this, you should have a look at the path flash code in function "sp_node_context_flash_path". Keep in mind that you should *not* keep a reference to the SPCanvasItem. The tempitem code deletes the object for you. The only valid use of the TemporaryItem* that you get from add_temporary_canvasitem is when you want to prematurely remove the item from the canvas, by calling " desktop->remove_temporary_canvasitem(tempitem); " .
- How can I display text using this mechanism?
Don't know if this is easy to do. The temp canvas item machinery only works with SPCanvasItem. Perhaps it is good to create an SPCanvasItem that renders text, because it can be used for many other things.
- If I want to make either the helper path or the text
permanent (i.e., convert them into a non-temporary item and save them in the document), how can I achieve this?
You can't convert an SPCanvasItem to SVG. So you have to manually do this, writing an svg:path or whatever to SVG.
Hope this helps, Johan
-----Original Message----- From: Maximilian Albert [mailto:Anhalter42@...173...] Sent: woensdag 18 juni 2008 3:22 To: inkscape Cc: Engelen, J.B.C. (Johan) Subject: Temporary canvas items
Hi all, (Johan, I'm CC'ing you because you actively worked in this area a while ago)
I'd like to use the temporary canvas item machinery to display some "info" related to LPEs. This info can consist of helper paths or perhaps even text (e.g., for LPEs measuring path lengths or areas). I've played a bit with it but I think I'm not using it in the correct/recommended/ easiest way, which sometimes even results in crashes.
So my questions are:
How can I create a temporary canvas item to display a helper path having a given shape?
How can I display text using this mechanism?
If I want to make either the helper path or the text
permanent (i.e., convert them into a non-temporary item and save them in the document), how can I achieve this?
Thanks for any help, Max