From 0fb7f118d4da3b048750f484ed6f9e211fbeca27 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 13 Sep 2014 23:38:00 +0000 Subject: add basic Xt stuff --- spectrogram.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'spectrogram.c') diff --git a/spectrogram.c b/spectrogram.c index 1578481..f6064db 100644 --- a/spectrogram.c +++ b/spectrogram.c @@ -17,6 +17,8 @@ #include #include +#include +#include "Sgraph.h" #include #include @@ -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("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 -- cgit v1.2.3