Re: PB : Catching delete & cut events / Returning nothing in some functions
- From: Lars Clausen <lars raeder dk>
- To: discussions about usage and development of dia <dia-list gnome org>
- Subject: Re: PB : Catching delete & cut events / Returning nothing in some functions
- Date: Sun, 11 Jun 2006 22:54:35 +0200
On Fri, 2006-06-02 at 16:22 +0200, SaTuRn 1 wrote:
I'm currently designing objects for Dia, that can be linked and I'm
wondering if its possible to catch events (like cut or delete) to
avoid technical problems ?
I explain myself. I have a Box (first object) on which I can add
Connector (second object). This second object should not exist whitout
being on a Box. But when the user supress a Box its Conectors still
I've seen in the sources that DiaObjects have parent/childrens
attributes. Will it solve the problem if I used these instead of my
own current lists ?
Another related problem, that I have, is I can't forbid the user to
copy or cut the connector and paste it anywhere on the diagram (major
problem for me if he does not paste it on a Box...). The "copy"
problem : if I return NULL in the copy function of the Connector Dia
crashes. The "cut event" one : I haven't find how to catch the event
You probably want to use the parent/child system. But it won't prevent
the user from unparenting (can't catch that) and cutting/copying it.
You definitely shouldn't make copy return null, it's used in loading
and/or creating new objects.
Why shouldn't the connectors exist without a box? Do they use anything
from the box? In general, Dia doesn't limit the placements of things
] [Thread Prev