Index: trunk/Ohana/src/opihi/cmd.data/section.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/section.c	(revision 4689)
+++ trunk/Ohana/src/opihi/cmd.data/section.c	(revision 5850)
@@ -6,4 +6,5 @@
   int Ngraph, Xgraph;
   Graphdata graphmode;
+  KapaSection section;
 
   List = FALSE;
@@ -21,8 +22,7 @@
   if (!GetGraph (&graphmode, &Xgraph, &Ngraph)) return (FALSE);
 
+  /* list sections */
   if (argc == 1) {
-    /* list section */
-    SendGraphCommand (Xgraph, 4, "LSEC");
-    SendGraphMessage (Xgraph, "* %s", argv[1]);
+    KapaGetSection (Xgraph, "*");
     fprintf (stderr, "USAGE: section name [x y dx dy]\n");
     return (TRUE);
@@ -30,18 +30,21 @@
   
   if (argc == 2) {
-    /* set section */
+    /* select / show section */
     if (List) {
-      SendGraphCommand (Xgraph, 4, "LSEC");
+      KapaGetSection (Xgraph, argv[1]);
     } else {
-      SendGraphCommand (Xgraph, 4, "SSEC");
+      KapaSelectSection (Xgraph, argv[1]);
     }
-    SendGraphMessage (Xgraph, "%s", argv[1]);
     return (TRUE);
   } 
   
   if (argc == 6) {
-    /* define section */
-    SendGraphCommand (Xgraph, 4, "DSEC");
-    SendGraphMessage (Xgraph, "%s %6.3f %6.3f %6.3f %6.3f", argv[1], atof (argv[2]), atof (argv[3]), atof (argv[4]), atof (argv[5]));
+    /* set section */
+    section.name = argv[1];
+    section.x = atof (argv[2]);
+    section.y = atof (argv[3]);
+    section.dx = atof (argv[4]);
+    section.dy = atof (argv[5]);
+    KapaSetSection (Xgraph, &section);
     return (TRUE);
   }
@@ -50,6 +53,6 @@
 }
 
-    /* should do some range checking on x y dx dy
-       should be between 0.0 and 1.0, precision of 0.001
-       is sufficient
-    */
+/* should do some range checking on x y dx dy
+   should be between 0.0 and 1.0, precision of 0.001
+   is sufficient
+*/
