[genius] Tue Oct 08 16:54:53 2013 Jiri (George) Lebl <jirka 5z com>



commit 616426e22b388069eb6c7fd0b4b4338b169d6063
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Tue Oct 8 16:55:03 2013 -0500

    Tue Oct 08 16:54:53 2013  Jiri (George) Lebl <jirka 5z com>
    
        * src/graphing.c: Very simple PlotCanvasFreeze/Thaw functions, need
          improvement and documentation

 ChangeLog      |    5 +++++
 src/graphing.c |   28 ++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7e863fd..17be4ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 08 16:54:53 2013  Jiri (George) Lebl <jirka 5z com>
+
+       * src/graphing.c: Very simple PlotCanvasFreeze/Thaw functions, need
+         improvement and documentation
+
 Thu Oct 03 17:15:40 2013  Jiri (George) Lebl <jirka 5z com>
 
        * lib/linear_algebra/linear_algebra.gel: Implement
diff --git a/src/graphing.c b/src/graphing.c
index 426ae7a..b33dc75 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -7997,6 +7997,30 @@ LinePlotClear_op (GelCtx *ctx, GelETree * * a, int *exception)
                return gel_makenum_null ();
 }
 
+static GelETree *
+PlotCanvasFreeze_op (GelCtx *ctx, GelETree * * a, int *exception)
+{
+       if (plot_canvas != NULL /* sanity */)
+               gtk_plot_canvas_freeze (GTK_PLOT_CANVAS (plot_canvas));
+
+       return gel_makenum_null ();
+}
+
+static GelETree *
+PlotCanvasThaw_op (GelCtx *ctx, GelETree * * a, int *exception)
+{
+       if (plot_canvas != NULL /* sanity */) {
+               gtk_plot_canvas_thaw (GTK_PLOT_CANVAS (plot_canvas));
+               gtk_plot_canvas_paint (GTK_PLOT_CANVAS (plot_canvas));
+               gtk_widget_queue_draw (GTK_WIDGET (plot_canvas));
+
+               if (gel_evalnode_hook != NULL)
+                       (*gel_evalnode_hook)();
+       }
+
+       return gel_makenum_null ();
+}
+
 static gboolean
 update_lineplot_window (double x1, double x2, double y1, double y2)
 {
@@ -9520,6 +9544,10 @@ gel_add_graph_functions (void)
        FUNC (LinePlotClear, 0, "", "plotting", N_("Show the line plot window and clear out functions"));
        VFUNC (LinePlotDrawLine, 2, "x1,y1,x2,y2,args", "plotting", N_("Draw a line from x1,y1 to x2,y2.  
x1,y1,x2,y2 can be replaced by a n by 2 matrix for a longer line"));
 
+       FUNC (PlotCanvasFreeze, 0, "", "plotting", N_("Freeze the plot canvas, that is, inhibit drawing"));
+       FUNC (PlotCanvasThaw, 0, "", "plotting", N_("Thaw the plot canvas and redraw the plot"));
+
+
        VFUNC (ExportPlot, 2, "filename,type", "plotting", N_("Export the current contents of the plot canvas 
to a file.  The file type is given by the string type, which can be \"png\", \"eps\", or \"ps\"."));
 
        PARAMETER (SlopefieldTicks, N_("Number of slopefield ticks as a vector [vertical,horizontal]."));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]