aboutsummaryrefslogtreecommitdiff
path: root/Sgraph.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-17 21:51:03 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-17 21:51:03 +0000
commit3408ce19b34c50ae566f52d3dad7638c41ae6dcd (patch)
tree445eb4c90d296bc6276c18ad9fb045457198766d /Sgraph.c
parenta9799dc301aa6a8638d634e722ed730666878067 (diff)
push data into widget
Diffstat (limited to 'Sgraph.c')
-rw-r--r--Sgraph.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Sgraph.c b/Sgraph.c
index c5b9804..9e4c89a 100644
--- a/Sgraph.c
+++ b/Sgraph.c
@@ -63,9 +63,12 @@ static XtResource resources[] = {
{ XtNrightData, XtCParameter, XtRPointer,
sizeof(XtPointer), XtOffset(SgraphWidget, sgraph.rightData),
XtRPointer, NULL },
- { XtNsizeData, XtCsizeData, XtRInt,
- sizeof(int), XtOffset(SgraphWidget, sgraph.sizeData),
+ { XtNsize, XtCsize, XtRInt,
+ sizeof(int), XtOffset(SgraphWidget, sgraph.size),
XtRImmediate, (XtPointer)2048 },
+ { XtNsamples, XtCsamples, XtRInt,
+ sizeof(int), XtOffset(SgraphWidget, sgraph.samples),
+ XtRImmediate, (XtPointer)0 },
};
#undef offset
@@ -152,8 +155,8 @@ Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs)
{
SgraphWidget sw = (SgraphWidget)w;
- sw->sgraph.leftData = XtCalloc(sw->sgraph.sizeData, sizeof(double));
- sw->sgraph.rightData = XtCalloc(sw->sgraph.sizeData, sizeof(double));
+ sw->sgraph.leftData = (double *)XtCalloc(sw->sgraph.size, sizeof(double));
+ sw->sgraph.rightData = (double *)XtCalloc(sw->sgraph.size, sizeof(double));
warnx("Initialize");
GetGC(w);
@@ -184,7 +187,8 @@ Resize(Widget w)
height = winheight;
warnx("win: %dx%d", winwidth, winheight);
warnx("sub: %dx%d", width, height);
- warnx("size: %d", sw->sgraph.sizeData);
+ warnx("size: %d", sw->sgraph.size);
+ warnx("samples: %d", sw->sgraph.samples);
if (sw->sgraph.bg != None)
XFreePixmap(XtDisplay(sw), sw->sgraph.bg);
@@ -223,6 +227,8 @@ Redisplay(Widget w, XEvent *event, Region r)
width - 2 * BORDER, height - 2 * BORDER);
*/
+ warnx("%lf : %lf" , sw->sgraph.leftData[0], sw->sgraph.rightData[0]);
+
XClearWindow(XtDisplay(sw), XtWindow(sw));
n = (n + 1) % width;
XCopyArea(XtDisplay(sw), sw->sgraph.bg, XtWindow(sw), sw->sgraph.foreGC,