aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-16 18:15:08 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-16 18:15:08 +0000
commit2c0095c270269c36c38a423bed4be6f3b6eeec9f (patch)
tree067e4537531b9c679b81b2e421fa8c91661c8d11
parentb58b3d8b52c41f604469bbb8f7c90d39dbccb33a (diff)
add data container
-rw-r--r--Sgraph.c5
-rw-r--r--SgraphP.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/Sgraph.c b/Sgraph.c
index d880c60..34cdd5a 100644
--- a/Sgraph.c
+++ b/Sgraph.c
@@ -143,7 +143,8 @@ Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs)
{
SgraphWidget sw = (SgraphWidget)w;
- sw->sgraph.data = NULL;
+ sw->sgraph.leftData = XtCalloc(sw->sgraph.sizeData, sizeof(double));
+ sw->sgraph.rightData = XtCalloc(sw->sgraph.sizeData, sizeof(double));
warnx("Initialize");
GetGC(w);
@@ -211,8 +212,6 @@ Redisplay(Widget w, XEvent *event, Region r)
width + BORDER, BORDER,
width - 2 * BORDER, height - 2 * BORDER);
*/
- if (sw->sgraph.data != NULL)
- warnx("%d", *(int *)sw->sgraph.data);
XClearWindow(XtDisplay(sw), XtWindow(sw));
n = (n + 1) % width;
diff --git a/SgraphP.h b/SgraphP.h
index b917fd1..7f6a100 100644
--- a/SgraphP.h
+++ b/SgraphP.h
@@ -41,7 +41,9 @@ typedef struct {
Pixel foreground;
Pixel background;
Boolean mirror;
- XtPointer data;
+ XtPointer leftData;
+ XtPointer rightData;
+ Cardinal sizeData;
GC foreGC;
GC backGC;