summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/graph.tcl26
-rw-r--r--src/bltGrElemOp.C35
2 files changed, 32 insertions, 29 deletions
diff --git a/library/graph.tcl b/library/graph.tcl
index 1c7e06a..6253570 100644
--- a/library/graph.tcl
+++ b/library/graph.tcl
@@ -196,7 +196,9 @@ proc blt::FlashPoint { g name index count } {
after 200 blt::FlashPoint $g $name $index $count
update
} else {
- catch {eval $g marker delete [$g marker names "bltClosest_*"]}
+ foreach mm [$g marker names "bltClosest_*"] {
+ catch {eval $g marker delete $mm}
+ }
}
}
@@ -234,10 +236,10 @@ proc blt::ZoomStack::ClickRelease { g } {
Init $g
bind zoom-$g <Enter> "focus %W"
- bind zoom-$g <KeyPress-Escape> { blt::ZoomStack::Reset %W }
- bind zoom-$g <ButtonPress-1> { blt::ZoomStack::DragStart %W %x %y }
- bind zoom-$g <B1-Motion> { blt::ZoomStack::DragMotion %W %x %y }
- bind zoom-$g <ButtonRelease-1> { blt::ZoomStack::DragFinish %W %x %y }
+ bind zoom-$g <KeyPress-Escape> {blt::ZoomStack::Reset %W}
+ bind zoom-$g <ButtonPress-1> {blt::ZoomStack::DragStart %W %x %y}
+ bind zoom-$g <B1-Motion> {blt::ZoomStack::DragMotion %W %x %y}
+ bind zoom-$g <ButtonRelease-1> {blt::ZoomStack::DragFinish %W %x %y}
bind zoom-$g <ButtonPress-3> {
if { [%W inside %x %y] } {
blt::ZoomStack::Reset %W
@@ -311,7 +313,9 @@ proc blt::ZoomStack::Pop { g } {
proc blt::ZoomStack::Push { g } {
variable _private
- catch {eval $g marker delete [$g marker names "zoom*"]}
+ foreach mm [$g marker names "zoom*"] {
+ catch {eval $g marker delete $mm}
+ }
if { [info exists _private($g,afterId)] } {
after cancel $_private($g,afterId)
}
@@ -366,9 +370,7 @@ proc blt::ZoomStack::Push { g } {
return
}
}
-# blt::busy hold $g
update; # This "update" redraws the graph
-# blt::busy release $g
}
proc blt::ZoomStack::SetAxisRanges { g axis min max } {
@@ -391,7 +393,9 @@ proc blt::ZoomStack::Reset { g } {
if { ![info exists _private($g,corner)] } {
Init $g
}
- catch {eval $g marker delete [$g marker names "zoom*"]}
+ foreach mm [$g marker names "zoom*"] {
+ catch {eval $g marker delete $mm}
+ }
if { $_private($g,corner) == "A" } {
# Reset the whole axis
@@ -496,7 +500,9 @@ proc blt::ZoomStack::DragFinish { g x y } {
if { [DragMotion $g $x $y] } {
Push $g
} else {
- catch {eval $g marker delete [$g marker names "zoom*"]}
+ foreach mm [$g marker names "zoom*"] {
+ catch {eval $g marker delete [$g marker names "zoom*"]}
+ }
if { [info exists _private($g,afterId)] } {
after cancel $_private($g,afterId)
}
diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C
index 6ea3f95..108ec6b 100644
--- a/src/bltGrElemOp.C
+++ b/src/bltGrElemOp.C
@@ -978,45 +978,42 @@ static int FetchVectorValues(Tcl_Interp* interp, ElemValues *valuesPtr,
static void VectorChangedProc(Tcl_Interp* interp, ClientData clientData,
Blt_VectorNotify notify)
{
- ElemValues *valuesPtr = (ElemValues*)clientData;
+ ElemValues* valuesPtr = (ElemValues*)clientData;
if (notify == BLT_VECTOR_NOTIFY_DESTROY)
FreeDataValues(valuesPtr);
else {
- Blt_Vector *vector;
+ Blt_Vector* vector;
Blt_GetVectorById(interp, valuesPtr->vectorSource.vector, &vector);
if (FetchVectorValues(NULL, valuesPtr, vector) != TCL_OK)
return;
}
- {
- Element* elemPtr = valuesPtr->elemPtr;
- Graph* graphPtr;
-
- graphPtr = elemPtr->obj.graphPtr;
- graphPtr->flags |= RESET_AXES;
- elemPtr->flags |= MAP_ITEM;
- if (!IGNORE_ELEMENT(elemPtr)) {
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
+
+ Element* elemPtr = valuesPtr->elemPtr;
+ Graph* graphPtr = elemPtr->obj.graphPtr;
+ graphPtr->flags |= RESET_AXES;
+ elemPtr->flags |= MAP_ITEM;
+ if (!IGNORE_ELEMENT(elemPtr)) {
+ graphPtr->flags |= CACHE_DIRTY;
+ Blt_EventuallyRedrawGraph(graphPtr);
}
}
static int GetVectorData(Tcl_Interp* interp, ElemValues *valuesPtr,
const char *vecName)
{
- Blt_Vector *vecPtr;
- VectorDataSource *srcPtr;
-
- srcPtr = &valuesPtr->vectorSource;
+ VectorDataSource *srcPtr = &valuesPtr->vectorSource;
srcPtr->vector = Blt_AllocVectorId(interp, vecName);
- if (Blt_GetVectorById(interp, srcPtr->vector, &vecPtr) != TCL_OK) {
+
+ Blt_Vector *vecPtr;
+ if (Blt_GetVectorById(interp, srcPtr->vector, &vecPtr) != TCL_OK)
return TCL_ERROR;
- }
+
if (FetchVectorValues(interp, valuesPtr, vecPtr) != TCL_OK) {
FreeVectorSource(valuesPtr);
return TCL_ERROR;
}
+
Blt_SetVectorChangedProc(srcPtr->vector, VectorChangedProc, valuesPtr);
valuesPtr->type = ELEM_SOURCE_VECTOR;
return TCL_OK;