[GRASS-SVN] r32247 - grass/trunk/gui/wxpython/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 24 04:10:06 EDT 2008


Author: martinl
Date: 2008-07-24 04:10:06 -0400 (Thu, 24 Jul 2008)
New Revision: 32247

Modified:
   grass/trunk/gui/wxpython/nviz/init.cpp
Log:
nviz2/wxGUI: G_unset_error_routine(), external routine for percent complete messages added (TODO: update gislib)

Modified: grass/trunk/gui/wxpython/nviz/init.cpp
===================================================================
--- grass/trunk/gui/wxpython/nviz/init.cpp	2008-07-24 07:12:20 UTC (rev 32246)
+++ grass/trunk/gui/wxpython/nviz/init.cpp	2008-07-24 08:10:06 UTC (rev 32247)
@@ -24,6 +24,7 @@
 
 static void swap_gl();
 static int print_error(const char *, const int);
+static int print_percent(int);
 static void print_sentence (PyObject*, const int, const char *);
 static PyObject *logStream;
 static int message_id = 1;
@@ -38,6 +39,8 @@
     logStream = log;
 
     G_set_error_routine(&print_error);
+    // TODO
+    // G_set_percent_routine(&print_percent);
 
     GS_libinit();
     /* GVL_libinit(); TODO */
@@ -57,6 +60,10 @@
 */
 Nviz::~Nviz()
 {
+    G_unset_error_routine();
+    // TODO
+    // G_unset_percent_routine();
+
     G_free((void *) data);
 
     data = NULL;
@@ -210,3 +217,13 @@
 
     message_id++;
 }
+
+int print_percent(int x)
+{
+    char msg[256];
+
+    sprintf(msg, "GRASS_INFO_PERCENT: %d\n", x);
+    PyFile_WriteString(msg, logStream);
+
+    return 0;
+}



More information about the grass-commit mailing list