aboutsummaryrefslogtreecommitdiff
path: root/spectrogram.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-13 23:38:00 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-13 23:38:00 +0000
commit0fb7f118d4da3b048750f484ed6f9e211fbeca27 (patch)
tree87c263049b16b084a0064a7a1ca801324f56da52 /spectrogram.c
parentdb65022a588f8b704474d4f5ebeb5c3d94aa39d6 (diff)
add basic Xt stuff
Diffstat (limited to 'spectrogram.c')
-rw-r--r--spectrogram.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/spectrogram.c b/spectrogram.c
index 1578481..f6064db 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -17,6 +17,8 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
+#include <X11/Intrinsic.h>
+#include "Sgraph.h"
#include <err.h>
#include <signal.h>
@@ -52,6 +54,45 @@ usage(void)
exit(0);
}
+static XrmOptionDescRec options[] = {
+ {"-mirror", "*Sgraph.mirror", XrmoptionNoArg, "TRUE" },
+ {"-nomirror", "*Sgprah.mirror", XrmoptionNoArg, "FALSE" },
+};
+
+static void
+quit()
+{
+ exit(0);
+}
+
+static XtActionsRec actionsList[] = {
+ { "quit", quit },
+};
+
+int
+main(int argc, char **argv)
+{
+ Widget toplevel, sgraph;
+
+ toplevel = XtInitialize(__progname, "Spectrograph",
+ options, XtNumber(options), &argc, argv);
+ XtAddActions(actionsList, 1);
+
+ if (argc != 1)
+ usage();
+
+ sgraph = XtCreateManagedWidget(__progname, sgraphWidgetClass,
+ toplevel, NULL, 0);
+ XtOverrideTranslations(sgraph,
+ XtParseTranslationTable("<Key>q: quit()"));
+
+ XtRealizeWidget(toplevel);
+ XtMainLoop();
+
+ return 0;
+}
+
+#if 0
int
main(int argc, char **argv)
{
@@ -241,3 +282,4 @@ main(int argc, char **argv)
return 0;
}
+#endif