|
From: Craig A. S. Ph.D. <cra...@ma...> - 2009-06-19 22:03:19
|
Hello,
I'm trying to develop an interactive application with two windows: one
in which a user drags a sphere around; another which plots a graph
(using gdisplay and gcurve).
When I use only the display, I can drag the sphere around fine, using
code similar to the toroid_drag.py example. When I add the graph
display, my first window doesn't receive left mouse button events
anymore and the sphere doesn't move. The order of window creation
doesn't change anything.
How can I have two windows and interactivity? I'm using VPython 5.1,
MacPython 2.6.2, on OS X 10.5.7.
Craig
--
Craig A. Struble, Ph.D. | 369 Cudahy Hall | Marquette University
Associate Professor of Computer Science | (414)288-3783
Director, Master of Bioinformatics Program | (414)288-5472 (fax)
http://www.mscs.mu.edu/~cstruble | cra...@ma...
|
|
From: Craig A. S. Ph.D. <cra...@ma...> - 2009-06-19 22:03:29
|
Hello,
I'm trying to develop an interactive application with two windows: one
in which a user drags a sphere around; another which plots a graph
(using gdisplay and gcurve).
When I use only the display, I can drag the sphere around fine, using
code similar to the toroid_drag.py example. When I add the graph
display, my first window doesn't receive left mouse button events
anymore and the sphere doesn't move. The order of window creation
doesn't change anything.
How can I have two windows and interactivity? I'm using VPython 5.1,
MacPython 2.6.2, on OS X 10.5.7.
Craig
--
Craig A. Struble, Ph.D. | 369 Cudahy Hall | Marquette University
Associate Professor of Computer Science | (414)288-3783
Director, Master of Bioinformatics Program | (414)288-5472 (fax)
http://www.mscs.mu.edu/~cstruble | cra...@ma...
|
|
From: Bruce S. <Bru...@nc...> - 2009-06-20 17:58:58
|
Puzzling and unfamiliar. Works fine for me on a MacBook with VPython
5.11, MacPython 2.6.2, OSX 10.5.7. There shouldn't be any difference in
this area between VPython 5.1 and 5.11.
Could you please post a small test routine that fails for you? I
successfully ran the following:
from visual.graph import *
scene.x = 0
scene.y = 400
scene.range = 4
b = box()
y = gcurve(color=color.cyan)
pick = None
while 1:
rate(50)
if scene.mouse.events:
m = scene.mouse.getevent()
if m.drag:
dragpos = m.pickpos
pick = m.pick
elif m.drop:
pick = None
if pick:
newpos = scene.mouse.pos
if newpos != dragpos:
pick.pos += newpos-dragpos
dragpos = newpos
y.plot(pos=(newpos.x,newpos.y))
Independent of the graph issue, I did notice that on Windows I didn't
need the "rate(50)" but I did on the Mac, where otherwise dragging was
sluggish.
Bruce Sherwood
Craig A. Struble, Ph.D. wrote:
> Hello,
>
> I'm trying to develop an interactive application with two windows: one
> in which a user drags a sphere around; another which plots a graph
> (using gdisplay and gcurve).
>
> When I use only the display, I can drag the sphere around fine, using
> code similar to the toroid_drag.py example. When I add the graph
> display, my first window doesn't receive left mouse button events
> anymore and the sphere doesn't move. The order of window creation
> doesn't change anything.
>
> How can I have two windows and interactivity? I'm using VPython 5.1,
> MacPython 2.6.2, on OS X 10.5.7.
>
> Craig
> --
> Craig A. Struble, Ph.D. | 369 Cudahy Hall | Marquette University
> Associate Professor of Computer Science | (414)288-3783
> Director, Master of Bioinformatics Program | (414)288-5472 (fax)
> http://www.mscs.mu.edu/~cstruble | cra...@ma...
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Visualpython-users mailing list
> Vis...@li...
> https://lists.sourceforge.net/lists/listinfo/visualpython-users
>
|
|
From: Craig S. <cra...@ma...> - 2009-06-21 14:03:05
|
After several hours of staring, I discovered a bug in my code which
caused the interaction loop to quit prematurely. After fixing that,
interaction with multiple windows works fine.
Sorry!
Craig
On Jun 20, 2009, at 12:58 PM, Bruce Sherwood wrote:
> Puzzling and unfamiliar. Works fine for me on a MacBook with VPython
> 5.11, MacPython 2.6.2, OSX 10.5.7. There shouldn't be any difference
> in
> this area between VPython 5.1 and 5.11.
>
> Could you please post a small test routine that fails for you? I
> successfully ran the following:
>
> from visual.graph import *
> scene.x = 0
> scene.y = 400
> scene.range = 4
> b = box()
> y = gcurve(color=color.cyan)
> pick = None
> while 1:
> rate(50)
> if scene.mouse.events:
> m = scene.mouse.getevent()
> if m.drag:
> dragpos = m.pickpos
> pick = m.pick
> elif m.drop:
> pick = None
> if pick:
> newpos = scene.mouse.pos
> if newpos != dragpos:
> pick.pos += newpos-dragpos
> dragpos = newpos
> y.plot(pos=(newpos.x,newpos.y))
>
> Independent of the graph issue, I did notice that on Windows I didn't
> need the "rate(50)" but I did on the Mac, where otherwise dragging was
> sluggish.
>
> Bruce Sherwood
>
> Craig A. Struble, Ph.D. wrote:
>> Hello,
>>
>> I'm trying to develop an interactive application with two windows:
>> one
>> in which a user drags a sphere around; another which plots a graph
>> (using gdisplay and gcurve).
>>
>> When I use only the display, I can drag the sphere around fine, using
>> code similar to the toroid_drag.py example. When I add the graph
>> display, my first window doesn't receive left mouse button events
>> anymore and the sphere doesn't move. The order of window creation
>> doesn't change anything.
>>
>> How can I have two windows and interactivity? I'm using VPython 5.1,
>> MacPython 2.6.2, on OS X 10.5.7.
>>
>> Craig
>> --
>> Craig A. Struble, Ph.D. | 369 Cudahy Hall | Marquette University
>> Associate Professor of Computer Science | (414)288-3783
>> Director, Master of Bioinformatics Program | (414)288-5472 (fax)
>> http://www.mscs.mu.edu/~cstruble | cra...@ma...
>>
>>
>> ------------------------------------------------------------------------------
>> Are you an open source citizen? Join us for the Open Source Bridge
>> conference!
>> Portland, OR, June 17-19. Two days of sessions, one day of
>> unconference: $250.
>> Need another reason to go? 24-hour hacker lounge. Register today!
>> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
>> _______________________________________________
>> Visualpython-users mailing list
>> Vis...@li...
>> https://lists.sourceforge.net/lists/listinfo/visualpython-users
>>
--
Craig A. Struble, Ph.D. | 369 Cudahy Hall | Marquette University
Associate Professor of Computer Science | (414)288-3783
Director, Master of Bioinformatics Program | (414)288-5472 (fax)
http://www.mscs.mu.edu/~cstruble | cra...@ma...
|
|
From: Bruce S. <Bru...@nc...> - 2009-06-21 19:31:12
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
That's a relief! Thanks for the update.<br>
<br>
Bruce Sherwood<br>
<br>
Craig Struble wrote:
<blockquote
cite="mid:F21...@ma..."
type="cite">
<pre wrap="">After several hours of staring, I discovered a bug in my code which
caused the interaction loop to quit prematurely. After fixing that,
interaction with multiple windows works fine.
Sorry!
Craig
On Jun 20, 2009, at 12:58 PM, Bruce Sherwood wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Puzzling and unfamiliar. Works fine for me on a MacBook with VPython
5.11, MacPython 2.6.2, OSX 10.5.7. There shouldn't be any difference
in
this area between VPython 5.1 and 5.11.
Could you please post a small test routine that fails for you? I
successfully ran the following:
from visual.graph import *
scene.x = 0
scene.y = 400
scene.range = 4
b = box()
y = gcurve(color=color.cyan)
pick = None
while 1:
rate(50)
if scene.mouse.events:
m = scene.mouse.getevent()
if m.drag:
dragpos = m.pickpos
pick = m.pick
elif m.drop:
pick = None
if pick:
newpos = scene.mouse.pos
if newpos != dragpos:
pick.pos += newpos-dragpos
dragpos = newpos
y.plot(pos=(newpos.x,newpos.y))
Independent of the graph issue, I did notice that on Windows I didn't
need the "rate(50)" but I did on the Mac, where otherwise dragging was
sluggish.
Bruce Sherwood
Craig A. Struble, Ph.D. wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello,
I'm trying to develop an interactive application with two windows:
one
in which a user drags a sphere around; another which plots a graph
(using gdisplay and gcurve).
When I use only the display, I can drag the sphere around fine, using
code similar to the toroid_drag.py example. When I add the graph
display, my first window doesn't receive left mouse button events
anymore and the sphere doesn't move. The order of window creation
doesn't change anything.
How can I have two windows and interactivity? I'm using VPython 5.1,
MacPython 2.6.2, on OS X 10.5.7.
Craig
--
Craig A. Struble, Ph.D. | 369 Cudahy Hall | Marquette University
Associate Professor of Computer Science | (414)288-3783
Director, Master of Bioinformatics Program | (414)288-5472 (fax)
<a class="moz-txt-link-freetext" href="http://www.mscs.mu.edu/~cstruble">http://www.mscs.mu.edu/~cstruble</a> | <a class="moz-txt-link-abbreviated" href="mailto:cra...@ma...">cra...@ma...</a>
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of
unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
<a class="moz-txt-link-freetext" href="http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org">http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org</a>
_______________________________________________
Visualpython-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a>
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
--
Craig A. Struble, Ph.D. | 369 Cudahy Hall | Marquette University
Associate Professor of Computer Science | (414)288-3783
Director, Master of Bioinformatics Program | (414)288-5472 (fax)
<a class="moz-txt-link-freetext" href="http://www.mscs.mu.edu/~cstruble">http://www.mscs.mu.edu/~cstruble</a> | <a class="moz-txt-link-abbreviated" href="mailto:cra...@ma...">cra...@ma...</a>
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
<a class="moz-txt-link-freetext" href="http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org">http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org</a>
_______________________________________________
Visualpython-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a>
</pre>
</blockquote>
</body>
</html>
|