From 04dfbe4e1b0470ef59c9e414baadc77f11aacbf6 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 14 Sep 2014 22:48:26 +0000 Subject: readd custom RealizeProc --- Sgraph.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Sgraph.c b/Sgraph.c index f382082..5e304ac 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -23,6 +23,7 @@ #include static void Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs); +static void Realize(Widget w, XtValueMask *mask, XSetWindowAttributes *attr); static void Action(Widget w, XEvent *event, String *params, Cardinal *num_params); static void Resize(Widget w); static void Redisplay(Widget w, XEvent *event, Region r); @@ -77,7 +78,7 @@ SgraphClassRec sgraphClassRec = { False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ - XtInheritRealize, /* realize */ + Realize, /* realize */ actions, /* actions */ XtNumber(actions), /* num_actions */ resources, /* resources */ @@ -146,6 +147,13 @@ Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs) GetGC(w); } +static void +Realize(Widget w, XtValueMask *mask, XSetWindowAttributes *attr) +{ + XtCreateWindow(w, InputOutput, CopyFromParent, *mask, attr); + Resize(w); +} + static void Resize(Widget w) { @@ -192,8 +200,6 @@ Redisplay(Widget w, XEvent *event, Region r) warnx("Redisplay"); - Resize(w); - XFillRectangle(XtDisplay(sw), XtWindow(sw), sw->sgraph.backGC, BORDER, BORDER, width - 2 * BORDER, height - 2 * BORDER); -- cgit v1.2.3