From 7dcfb00b4f61a9775887eeca2362450a761ab2ed Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 19 Oct 2014 20:32:16 +0000 Subject: add TraceOnce --- Sgraph.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Sgraph.c') diff --git a/Sgraph.c b/Sgraph.c index cbcabf3..20091d7 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -24,6 +24,13 @@ #include #define Trace(w) warnx("%s.%s", XtClass(w)->core_class.class_name, __func__) +#define TraceOnce(w) do { \ + static int once = 1; \ + if (once) { \ + Trace(w); \ + once = 0; \ + } \ +} while (0) static void Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs); static void Realize(Widget w, XtValueMask *mask, XSetWindowAttributes *attr); @@ -192,9 +199,7 @@ Redisplay(Widget w, XEvent *event, Region r) if (!XtIsRealized(w)) return; -#if 0 - Trace(w); -#endif + TraceOnce(w); width = sw->core.width; if (width > sw->sgraph.size) -- cgit v1.2.3