Mailing List Archive

Help. Tracking ButtonRelease events
Hello.

I'm writing an application part of which is a GUI to draw graphs.
What i want is create verticies and edges between them,
i create vertex by clicking on Button 1 ( taken from Demo/Tkinter/matt
scripts )
and edge created by clicking on Button 3 and dragging the mouse to the
destination vertex.
In order to do it every vertex binded events ButtonPress-3 and
ButtonRelease-3 ,
the problem i run into is that when i press button 3 and drag it to the
destination vertex,
source vertex gets the ButtonRelease-3 event and not destination.

Am i missing something and how can it be solved ?

Thanks in advance
Philip
Help. Tracking ButtonRelease events [ In reply to ]
This is not a direct answer, but hopefully it is a help.
I am working on a bit similar program and I have put out some code.
http://www.nexus.hu/hever/prog/vu/visualut.py <=main program
http://www.nexus.hu/hever/prog/vu/frameobj.py <= module
http://www.nexus.hu/hever/prog/vu/vu.gif <= help, a picture of the
program
It grew out from the same script(s) you mentioned, there are same problems
you have now that I had to solve somehow.
In the frameobj.py module there is a "class Connecting_Objects:" which does
that. I maintain an ordered taglist for additional information.

Zsolt

----------
> From: Philip Derbeko <sphilip@techst02.technion.ac.il>
> To: python-list@python.org
> Subject: Help. Tracking ButtonRelease events
> Date: 1999. augusztus 7. 14:09
>
> Hello.
>
> I'm writing an application part of which is a GUI to draw graphs.
> What i want is create verticies and edges between them,
> i create vertex by clicking on Button 1 ( taken from Demo/Tkinter/matt
> scripts )
> and edge created by clicking on Button 3 and dragging the mouse to the
> destination vertex.
> In order to do it every vertex binded events ButtonPress-3 and
> ButtonRelease-3 ,
> the problem i run into is that when i press button 3 and drag it to the
> destination vertex,
> source vertex gets the ButtonRelease-3 event and not destination.
>
> Am i missing something and how can it be solved ?
>
> Thanks in advance
> Philip
>
>
>
> --
> http://www.python.org/mailman/listinfo/python-list
Help. Tracking ButtonRelease events [ In reply to ]
--------------EB0824A994C62E9055B99731
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello.

Thanks for your help.

Actually I wanted to reduce the complexity of this to O(1) , since search is
O(log N).
Well I've found another way of doing it , in the cost of changing a GUI a bit
:
now if you want to draw an edge you click on the source vertex ( regular click
with release)
move pointer to the destination , pointer followed by the edge , and click on
it.
This is the same model as in XFig for example.
I've done it by tracking enter and leave events for each vertex , this way i
know when and which vertex entered
and if button was clicked in it.
I'm sorry i can't post the code , its in very early development stage ,
if you want it anyway email me.

Regards
Philip

Hever Zsolt wrote:

> This is not a direct answer, but hopefully it is a help.
> I am working on a bit similar program and I have put out some code.
> http://www.nexus.hu/hever/prog/vu/visualut.py <=main program
> http://www.nexus.hu/hever/prog/vu/frameobj.py <= module
> http://www.nexus.hu/hever/prog/vu/vu.gif <= help, a picture of the
> program
> It grew out from the same script(s) you mentioned, there are same problems
> you have now that I had to solve somehow.
> In the frameobj.py module there is a "class Connecting_Objects:" which does
> that. I maintain an ordered taglist for additional information.
>
> Zsolt
>

--------------EB0824A994C62E9055B99731
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Hello.
<P>Thanks for your help.
<P>Actually I wanted to reduce the complexity of this to O(1) , since search
is O(log N).
<BR>Well I've found another way of doing it , in the cost of changing a
GUI a bit :
<BR>now if you want to draw an edge you click on the source vertex ( regular
click with release)
<BR>move pointer to the destination , pointer followed by the edge , and
click on it.
<BR>This is the same model as in XFig for example.
<BR>I've done it by tracking enter and leave events for each vertex , this
way i know when and which vertex entered
<BR>and if button was clicked in it.
<BR>I'm sorry i can't post the code , its in very early development stage
,
<BR>if you want it anyway email me.
<P>Regards
<BR>Philip
<P>Hever Zsolt wrote:
<BLOCKQUOTE TYPE=CITE>This is not&nbsp; a direct answer, but hopefully
it is a help.
<BR>I am working on a bit similar program and I have put out some code.
<BR><A HREF="http://www.nexus.hu/hever/prog/vu/visualut.py">http://www.nexus.hu/hever/prog/vu/visualut.py</A>
&lt;=main program
<BR><A HREF="http://www.nexus.hu/hever/prog/vu/frameobj.py">http://www.nexus.hu/hever/prog/vu/frameobj.py</A>
&lt;= module
<BR><A HREF="http://www.nexus.hu/hever/prog/vu/vu.gif">http://www.nexus.hu/hever/prog/vu/vu.gif</A>&nbsp;&nbsp;&nbsp;
&lt;= help, a picture of the
<BR>program
<BR>It grew out from the same script(s) you mentioned, there are same problems
<BR>you have now that I had to solve somehow.
<BR>In the frameobj.py module there is a "class Connecting_Objects:" which
does
<BR>that. I maintain an ordered taglist for additional information.
<P>Zsolt
<BR><A HREF="http://www.python.org/mailman/listinfo/python-list"></A>&nbsp;</BLOCKQUOTE>
</HTML>

--------------EB0824A994C62E9055B99731--