[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10825 - in gnuradio/branches/developers/jblum/grc/grc
From: |
jblum |
Subject: |
[Commit-gnuradio] r10825 - in gnuradio/branches/developers/jblum/grc/grc/src: gui platforms/gui |
Date: |
Tue, 14 Apr 2009 02:22:15 -0600 (MDT) |
Author: jblum
Date: 2009-04-14 02:22:14 -0600 (Tue, 14 Apr 2009)
New Revision: 10825
Modified:
gnuradio/branches/developers/jblum/grc/grc/src/gui/Constants.py
gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/FlowGraph.py
Log:
Use events pending to throttle animation/drawing.
Replaces timestamp method.
Modified: gnuradio/branches/developers/jblum/grc/grc/src/gui/Constants.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/gui/Constants.py
2009-04-14 06:35:50 UTC (rev 10824)
+++ gnuradio/branches/developers/jblum/grc/grc/src/gui/Constants.py
2009-04-14 08:22:14 UTC (rev 10825)
@@ -51,8 +51,6 @@
SCROLL_PROXIMITY_SENSITIVITY = 30
##When the window has to be scrolled, move it this distance in the required
direction.
SCROLL_DISTANCE = 15
-##The redrawing sensitivity, how many seconds must pass between motion events
before a redraw?
-MOTION_DETECT_REDRAWING_SENSITIVITY = .02
##How close the mouse click can be to a connection and register a connection
select.
CONNECTION_SELECT_SENSITIVITY = 5
Modified:
gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/FlowGraph.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/FlowGraph.py
2009-04-14 06:35:50 UTC (rev 10824)
+++ gnuradio/branches/developers/jblum/grc/grc/src/platforms/gui/FlowGraph.py
2009-04-14 08:22:14 UTC (rev 10825)
@@ -19,8 +19,7 @@
from ... gui.Constants import \
DIR_LEFT, DIR_RIGHT, \
- SCROLL_PROXIMITY_SENSITIVITY, SCROLL_DISTANCE, \
- MOTION_DETECT_REDRAWING_SENSITIVITY
+ SCROLL_PROXIMITY_SENSITIVITY, SCROLL_DISTANCE
from ... gui.Actions import \
ELEMENT_CREATE, ELEMENT_SELECT, \
BLOCK_PARAM_MODIFY, BLOCK_MOVE, \
@@ -33,7 +32,6 @@
pygtk.require('2.0')
import gtk
import random
-import time
from ... gui import Messages
class FlowGraph(Element):
@@ -55,7 +53,6 @@
self.element_moved = False
self.mouse_pressed = False
self.unselect()
- self.time = 0
self.press_coor = (0, 0)
#selected ports
self._old_selected_port = None
@@ -460,9 +457,8 @@
Move a selected element to the new coordinate.
Auto-scroll the scroll bars at the boundaries.
"""
- #to perform a movement, the mouse must be pressed, timediff
large enough
- if not self.mouse_pressed: return
- if time.time() - self.time <
MOTION_DETECT_REDRAWING_SENSITIVITY: return
+ #to perform a movement, the mouse must be pressed, no pending
events
+ if gtk.events_pending() or not self.mouse_pressed: return
#perform autoscrolling
width, height = self.get_size()
x, y = coordinate
@@ -486,7 +482,5 @@
X, Y = self.get_coordinate()
if not self.get_ctrl_mask(): self.move_selected((int(x - X),
int(y - Y)))
self.set_coordinate((x, y))
- #update time
- self.time = time.time()
#queue draw for animation
self.queue_draw()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10825 - in gnuradio/branches/developers/jblum/grc/grc/src: gui platforms/gui,
jblum <=