Re: Flushing position changes to the display



Am 03.08.2008 16:57, Fred Morcos schrieb:
Now I did somediaobj->position.x = 5;

To move an object you should use either
  obj->ops->move()
or
  obj->ops->move_handle()

This way the object can adapt it's internal state to the change. From lib/object.h :

/*!
  \class _DiaObject

  \brief Base class for all of Dia's objects, i.e. diagram building blocks

  The base class in the DiaObject hierarchy.
  All information in this structure read-only
  from the application point of view except
  when connection objects. (Then handles and
  connections are changed).

  position is not necessarly the corner of the object, but rather
  some 'good' spot on it which will be natural to snap to.
*/

how do I flush these changes to the display?

trying
object_add_updates_list(DIA_DIAGRAM_DATA(diagram)->selected, diagram);
diagram_flush(ddisp->diagram);

didn't work.


  object_add_updates(obj, ddisp->diagram);
  diagram_update_connections_object(ddisp->diagram, obj, TRUE);
  diagram_flush(ddisp->diagram);

when i try to move the object on the canvas (using the mouse) it
suddenly moves to the position. but i cant seem to find anything
relevant in the mouse callbacks...

You should als take care to call undo_move_objects() somewhere otherwise your modification can not be undone.

-------- 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]