aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-26 14:06:38 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-26 14:06:38 +0000
commit9503774686c335ebd43b1b605bfff09389b574f3 (patch)
tree957b7104386245b9d7c02429e7a112f1c8aa5aa0
parent1a5297ec85d1e3fddaf9bc4ca5819e3020a056ab (diff)
switch to XtApp..., add fallback resources
-rw-r--r--spectrogram.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/spectrogram.c b/spectrogram.c
index f4aec87..a018233 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -94,16 +94,24 @@ worker(XtPointer data)
return False; /* don't remove the work procedure from the list */
}
+String fallback[] = {
+ "*foreground: gold",
+ "*background: navy",
+ NULL,
+};
+
int
main(int argc, char **argv)
{
+ XtAppContext app;
Widget toplevel, sgraph;
int n, samples;
Arg args[10];
- toplevel = XtInitialize(__progname, "Spectrograph",
- options, XtNumber(options), &argc, argv);
- XtAddActions(actionsList, XtNumber(actionsList));
+ toplevel = XtAppInitialize(&app, "Spectrograph",
+ options, XtNumber(options), &argc, argv,
+ fallback, NULL, 0);
+ XtAppAddActions(app, actionsList, XtNumber(actionsList));
if (argc != 1)
usage();
@@ -114,17 +122,15 @@ main(int argc, char **argv)
n = 0;
XtSetArg(args[n], XtNsamples, samples); n++;
- //XtSetArg(args[n], XtNforeground, "gold"); n++;
- //XtSetArg(args[n], XtNbackground, "navy"); n++;
- sgraph = XtCreateManagedWidget(__progname, sgraphWidgetClass,
+ sgraph = XtCreateManagedWidget("SGraph", sgraphWidgetClass,
toplevel, args, n);
XtOverrideTranslations(sgraph,
XtParseTranslationTable("<Key>q: quit()"));
- XtAddWorkProc(worker, sgraph);
+ XtAppAddWorkProc(app, worker, sgraph);
XtRealizeWidget(toplevel);
- XtMainLoop();
+ XtAppMainLoop(app);
return 0;
}