summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e05e2c8)
raw | patch | inline | side by side (parent: e05e2c8)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 18 Jun 2008 08:26:43 +0000 (08:26 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 18 Jun 2008 08:26:43 +0000 (08:26 +0000) |
src/desktop.cpp | patch | blob | history |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index e16b030a44dfc9d2c2705502fcc61b661bcc172e..932d79ff2e7dadfe24d1c6e3cee85e5db55c0d79 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
/* Public methods */
+/* These methods help for temporarily showing things on-canvas.
+ * 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).
+ */
/** Note that lifetime is measured in milliseconds
-* it is perfectly safe to ignore the returned pointer: the object is deleted by itself, so don't delete it elsewhere!
-* The return value should only be used as argument for SPDesktop::remove_temporary_canvasitem, because the object might be deleted already.
-* move_to_bottom = true by default so the item does not interfere with handling of other items on the canvas like nodes.
-*/
+ * One should *not* keep a reference to the SPCanvasItem, the temporary item code will
+ * delete the object for you and the reference will become invalid without you knowing it.
+ * It is perfectly safe to ignore the returned pointer: the object is deleted by itself, so don't delete it elsewhere!
+ * The *only* valid use of the returned TemporaryItem* is as argument for SPDesktop::remove_temporary_canvasitem,
+ * because the object might be deleted already without you knowing it.
+ * move_to_bottom = true by default so the item does not interfere with handling of other items on the canvas like nodes.
+ */
Inkscape::Display::TemporaryItem *
SPDesktop::add_temporary_canvasitem (SPCanvasItem *item, guint lifetime, bool move_to_bottom)
{