1 /* demo-Xm.c --- implements the interactive demo-mode and options dialogs.
2 * xscreensaver, Copyright (c) 1999, 2003 Jamie Zawinski <jwz@jwz.org>
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation. No representations are made about the suitability of this
9 * software for any purpose. It is provided "as is" without express or
17 #include <X11/Xatom.h>
18 #include <X11/Intrinsic.h>
20 #include <X11/IntrinsicP.h> /* just for debug info */
21 #include <X11/ShellP.h>
23 #include <X11/Shell.h>
28 #include <Xm/ScrolledW.h>
31 #include <Xm/PushBG.h>
34 #include <Xm/ToggleBG.h>
35 #include <Xm/CascadeBG.h>
36 #include <Xm/RowColumn.h>
37 #include <Xm/LabelG.h>
38 #include <Xm/SeparatoG.h>
39 #include <Xm/SelectioB.h>
41 #ifdef HAVE_XMCOMBOBOX /* a Motif 2.0 widget */
42 # include <Xm/ComboBox.h>
43 # ifndef XmNtextField /* Lesstif 0.89.4 bug */
44 # undef HAVE_XMCOMBOBOX
46 #endif /* HAVE_XMCOMBOBOX */
53 const char *visual_menu[] = {
54 "Any", "Best", "Default", "Default-N", "GL", "TrueColor", "PseudoColor",
55 "StaticGray", "GrayScale", "DirectColor", "Color", "Gray", "Mono", 0
60 static Widget create_demos_page (Widget parent);
61 static Widget create_options_page (Widget parent);
64 tab_cb (Widget button, XtPointer client_data, XtPointer ignored)
66 Widget parent = XtParent(button);
67 Widget tabber = XtNameToWidget (parent, "*folder");
68 Widget this_tab = (Widget) client_data;
73 XtVaGetValues (tabber, XmNnumChildren, &nkids, XmNchildren, &kids, NULL);
76 XtUnmanageChildren (kids, nkids);
78 XtManageChild (this_tab);
83 create_xscreensaver_demo (Widget parent)
96 Widget mainw, form, menubar;
97 Widget demo_tab, options_tab, hr, tabber, demos, options;
101 mainw = XmCreateMainWindow (parent, "demoForm", av, ac);
102 form = XmCreateForm (mainw, "form", av, ac);
103 menubar = XmCreateSimpleMenuBar (form, "menubar", av, ac);
104 XtVaSetValues (menubar,
105 XmNtopAttachment, XmATTACH_FORM,
106 XmNleftAttachment, XmATTACH_FORM,
107 XmNrightAttachment, XmATTACH_FORM,
111 Widget menu = 0, item = 0;
113 "*file", "blank", "lock", "kill", "restart", "-", "exit",
114 "*edit", "cut", "copy", "paste",
115 "*help", "about", "docMenu" };
117 for (i = 0; i < sizeof(menus)/sizeof(*menus); i++)
120 if (menus[i][0] == '-')
121 item = XmCreateSeparatorGadget (menu, "separator", av, ac);
122 else if (menus[i][0] != '*')
123 item = XmCreatePushButtonGadget (menu, menus[i], av, ac);
126 menu = XmCreatePulldownMenu (parent, menus[i]+1, av, ac);
127 XtSetArg (av [ac], XmNsubMenuId, menu); ac++;
128 item = XmCreateCascadeButtonGadget (menubar, menus[i]+1, av, ac);
130 if (!strcmp (menus[i]+1, "help"))
131 XtVaSetValues(menubar, XmNmenuHelpWidget, item, NULL);
133 XtManageChild (item);
138 demo_tab = XmCreatePushButtonGadget (form, "demoTab", av, ac);
139 XtVaSetValues (demo_tab,
140 XmNleftAttachment, XmATTACH_FORM,
141 XmNtopAttachment, XmATTACH_WIDGET,
142 XmNtopWidget, menubar,
145 options_tab = XmCreatePushButtonGadget (form, "optionsTab", av, ac);
146 XtVaSetValues (options_tab,
147 XmNleftAttachment, XmATTACH_WIDGET,
148 XmNleftWidget, demo_tab,
149 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
150 XmNtopWidget, demo_tab,
151 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
152 XmNbottomWidget, demo_tab,
155 hr = XmCreateSeparatorGadget (form, "hr", av, ac);
157 XmNleftAttachment, XmATTACH_FORM,
158 XmNrightAttachment, XmATTACH_FORM,
159 XmNtopAttachment, XmATTACH_WIDGET,
160 XmNtopWidget, demo_tab,
163 tabber = XmCreateForm (form, "folder", av, ac);
164 XtVaSetValues (tabber,
165 XmNtopAttachment, XmATTACH_WIDGET,
167 XmNleftAttachment, XmATTACH_FORM,
168 XmNrightAttachment, XmATTACH_FORM,
169 XmNbottomAttachment, XmATTACH_FORM,
172 demos = create_demos_page (tabber);
173 options = create_options_page (tabber);
175 XtAddCallback (demo_tab, XmNactivateCallback, tab_cb, demos);
176 XtAddCallback (options_tab, XmNactivateCallback, tab_cb, options);
178 XtManageChild (demos);
179 XtManageChild (options);
181 XtManageChild (demo_tab);
182 XtManageChild (options_tab);
184 XtManageChild (menubar);
185 XtManageChild (tabber);
186 XtManageChild (form);
189 XtUnmanageChild (options);
190 XtManageChild (demos);
198 create_demos_page (Widget parent)
200 /* Form1 (horizontal)
204 ButtonBox1 (vertical)
212 Text ("Command Line")
218 ButtonBox2 (vertical)
220 Button ("Documentation")
222 Widget form1, form2, form3, form4;
223 Widget scroller, list, buttonbox1, down, up;
224 Widget frame, frame_label, doc, cmd_label, cmd_text, enabled, vis_label;
226 Widget hr, buttonbox2, demo, man;
231 form1 = XmCreateForm (parent, "form1", av, ac);
232 form2 = XmCreateForm (form1, "form2", av, ac);
233 XtVaSetValues (form2,
234 XmNtopAttachment, XmATTACH_FORM,
235 XmNleftAttachment, XmATTACH_FORM,
236 XmNbottomAttachment, XmATTACH_FORM,
239 scroller = XmCreateScrolledWindow (form2, "scroller", av, ac);
240 XtVaSetValues (scroller,
241 XmNtopAttachment, XmATTACH_FORM,
242 XmNleftAttachment, XmATTACH_FORM,
243 XmNrightAttachment, XmATTACH_FORM,
244 XmNbottomAttachment, XmATTACH_WIDGET,
246 list = XmCreateList (scroller, "list", av, ac);
248 buttonbox1 = XmCreateForm (form2, "buttonbox1", av, ac);
249 XtVaSetValues (buttonbox1,
250 XmNleftAttachment, XmATTACH_FORM,
251 XmNrightAttachment, XmATTACH_FORM,
252 XmNbottomAttachment, XmATTACH_FORM,
254 XtVaSetValues (scroller, XmNbottomWidget, buttonbox1, NULL);
256 down = XmCreatePushButton (buttonbox1, "down", av, ac);
258 XmNleftAttachment, XmATTACH_FORM,
259 XmNtopAttachment, XmATTACH_FORM,
260 XmNbottomAttachment, XmATTACH_FORM,
262 up = XmCreatePushButton (buttonbox1, "up", av, ac);
264 XmNleftAttachment, XmATTACH_WIDGET,
266 XmNtopAttachment, XmATTACH_FORM,
267 XmNbottomAttachment, XmATTACH_FORM,
270 form3 = XmCreateForm (form1, "form3", av, ac);
271 XtVaSetValues (form3,
272 XmNtopAttachment, XmATTACH_FORM,
273 XmNleftAttachment, XmATTACH_WIDGET,
274 XmNleftWidget, form2,
275 XmNrightAttachment, XmATTACH_FORM,
276 XmNbottomAttachment, XmATTACH_FORM,
278 frame = XmCreateFrame (form3, "frame", av, ac);
281 XtSetArg (av [ac], XmNchildType, XmFRAME_TITLE_CHILD); ac++;
282 frame_label = XmCreateLabelGadget (frame, "frameLabel", av, ac);
285 XtVaSetValues (frame,
286 XmNtopAttachment, XmATTACH_FORM,
287 XmNleftAttachment, XmATTACH_FORM,
288 XmNrightAttachment, XmATTACH_FORM,
289 XmNbottomAttachment, XmATTACH_WIDGET,
293 XtSetArg (av [ac], XmNchildType, XmFRAME_WORKAREA_CHILD); ac++;
294 doc = XmCreateText (frame, "doc", av, ac);
299 XmNcursorPositionVisible, FALSE,
301 XmNeditMode, XmMULTI_LINE_EDIT,
302 XmNshadowThickness, 0,
305 cmd_label = XmCreateLabelGadget (form3, "cmdLabel", av, ac);
306 XtVaSetValues (cmd_label,
307 XmNleftAttachment, XmATTACH_FORM,
308 XmNrightAttachment, XmATTACH_FORM,
309 XmNbottomAttachment, XmATTACH_WIDGET,
311 XtVaSetValues (frame, XmNbottomWidget, cmd_label, NULL);
313 cmd_text = XmCreateTextField (form3, "cmdText", av, ac);
314 XtVaSetValues (cmd_text,
315 XmNleftAttachment, XmATTACH_FORM,
316 XmNrightAttachment, XmATTACH_FORM,
317 XmNbottomAttachment, XmATTACH_WIDGET,
319 XtVaSetValues (cmd_label, XmNbottomWidget, cmd_text, NULL);
321 form4 = XmCreateForm (form3, "form4", av, ac);
322 XtVaSetValues (form4,
323 XmNleftAttachment, XmATTACH_FORM,
324 XmNrightAttachment, XmATTACH_FORM,
325 XmNbottomAttachment, XmATTACH_WIDGET,
327 XtVaSetValues (cmd_text, XmNbottomWidget, form4, NULL);
329 enabled = XmCreateToggleButtonGadget (form4, "enabled", av, ac);
330 XtVaSetValues (enabled,
331 XmNtopAttachment, XmATTACH_FORM,
332 XmNleftAttachment, XmATTACH_FORM,
333 XmNbottomAttachment, XmATTACH_FORM,
335 vis_label = XmCreateLabelGadget (form4, "visLabel", av, ac);
336 XtVaSetValues (vis_label,
337 XmNtopAttachment, XmATTACH_FORM,
338 XmNleftAttachment, XmATTACH_WIDGET,
339 XmNleftWidget, enabled,
340 XmNbottomAttachment, XmATTACH_FORM,
342 #ifdef HAVE_XMCOMBOBOX
346 XtSetArg (av [ac], XmNcomboBoxType, XmDROP_DOWN_COMBO_BOX); ac++;
347 combo = XmCreateComboBox (form4, "combo", av, ac);
348 for (i = 0; visual_menu[i]; i++)
350 XmString xs = XmStringCreate ((char *) visual_menu[i],
351 XmSTRING_DEFAULT_CHARSET);
352 XmComboBoxAddItem (combo, xs, 0, False);
355 XtVaGetValues (combo, XmNlist, &list, NULL);
356 XtVaSetValues (list, XmNvisibleItemCount, i, NULL);
358 #else /* !HAVE_XMCOMBOBOX */
360 Widget popup_menu = XmCreatePulldownMenu (parent, "menu", av, ac);
362 for (i = 0; visual_menu[i]; i++)
364 XmString xs = XmStringCreate ((char *) visual_menu[i],
365 XmSTRING_DEFAULT_CHARSET);
367 XtSetArg (av [ac], XmNlabelString, xs); ac++;
368 kids[i] = XmCreatePushButtonGadget (popup_menu, "button", av, ac);
369 /* XtAddCallback (combo, XmNactivateCallback, visual_popup_cb,
373 XtManageChildren (kids, i);
376 XtSetArg (av [ac], XmNsubMenuId, popup_menu); ac++;
377 combo = XmCreateOptionMenu (form4, "combo", av, ac);
380 #endif /* !HAVE_XMCOMBOBOX */
382 XtVaSetValues (combo,
383 XmNtopAttachment, XmATTACH_FORM,
384 XmNleftAttachment, XmATTACH_WIDGET,
385 XmNleftWidget, vis_label,
386 XmNbottomAttachment, XmATTACH_FORM,
389 hr = XmCreateSeparatorGadget (form3, "hr", av, ac);
391 XmNleftAttachment, XmATTACH_FORM,
392 XmNrightAttachment, XmATTACH_FORM,
393 XmNbottomAttachment, XmATTACH_WIDGET,
395 XtVaSetValues (form4, XmNbottomWidget, hr, NULL);
397 buttonbox2 = XmCreateForm (form3, "buttonbox2", av, ac);
398 XtVaSetValues (buttonbox2,
399 XmNleftAttachment, XmATTACH_FORM,
400 XmNrightAttachment, XmATTACH_FORM,
401 XmNbottomAttachment, XmATTACH_FORM,
403 XtVaSetValues (hr, XmNbottomWidget, buttonbox2, NULL);
405 demo = XmCreatePushButtonGadget (buttonbox2, "demo", av, ac);
407 XmNleftAttachment, XmATTACH_FORM,
408 XmNtopAttachment, XmATTACH_FORM,
409 XmNbottomAttachment, XmATTACH_FORM,
411 man = XmCreatePushButtonGadget (buttonbox2, "man", av, ac);
413 XmNrightAttachment, XmATTACH_FORM,
414 XmNtopAttachment, XmATTACH_FORM,
415 XmNbottomAttachment, XmATTACH_FORM,
418 XtManageChild (demo);
420 XtManageChild (buttonbox2);
423 XtManageChild (combo);
424 XtManageChild (vis_label);
425 XtManageChild (enabled);
426 XtManageChild (form4);
428 XtManageChild (cmd_text);
429 XtManageChild (cmd_label);
432 XtManageChild (frame_label);
433 XtManageChild (frame);
434 XtManageChild (form3);
437 XtManageChild (down);
438 XtManageChild (buttonbox1);
440 XtManageChild (list);
441 XtManageChild (scroller);
442 XtManageChild (form2);
444 XtManageChild (form1);
446 XtVaSetValues (form1,
447 XmNleftAttachment, XmATTACH_FORM,
448 XmNrightAttachment, XmATTACH_FORM,
449 XmNtopAttachment, XmATTACH_FORM,
450 XmNbottomAttachment, XmATTACH_FORM,
459 create_options_page (Widget parent)
461 /* This is what the layout is today:
464 Label ("Saver Timeout")
465 Label ("Cycle Timeout")
466 Label ("Fade Duration")
468 Label ("Lock Timeout")
469 Label ("Password Timeout")
479 Toggle ("Install Colormap")
480 Toggle ("Fade Colormap")
481 Toggle ("Unfade Colormap")
482 Toggle ("Require Password")
489 /* This is what it should be:
492 Form (vertical) ("column1")
494 Label ("Blanking and Locking")
496 Label ("Blank After")
497 Label ("Cycle After")
501 Checkbox ("Require Password")
505 Label ("Image Manipulation")
507 Checkbox ("Grab Desktop Images")
508 Checkbox ("Grab Video Frames")
509 Checkbox ("Choose Random Image")
513 Label ("Diagnostics")
515 Checkbox ("Verbose Diagnostics")
516 Checkbox ("Display Subprocess Errors")
517 Checkbox ("Display Splash Screen at Startup")
518 Form (vertical) ("column2")
520 Label ("Display Power Management")
522 Checkbox ("Power Management Enabled")
523 Label ("Standby After")
524 Label ("Suspend After")
526 Text ("Standby After")
527 Text ("Suspend After")
532 Checkbox ("Install Colormap")
534 Checkbox ("Fade To Black When Blanking")
535 Checkbox ("Fade From Black When Unblanking")
536 Label ("Fade Duration")
537 Text ("Fade Duration")
568 Widget children[100];
569 Widget timeout_label, cycle_label, fade_seconds_label, fade_ticks_label;
570 Widget lock_label, passwd_label, hr;
571 Widget preferences_form;
573 Widget timeout_text, cycle_text, fade_text, fade_ticks_text;
574 Widget lock_timeout_text, passwd_timeout_text, verbose_toggle;
575 Widget install_cmap_toggle, fade_toggle, unfade_toggle;
576 Widget lock_toggle, prefs_done, prefs_cancel;
579 XtSetArg (av [ac], XmNdialogType, XmDIALOG_PROMPT); ac++;
582 XtSetArg (av [ac], XmNtopAttachment, XmATTACH_FORM); ac++;
583 XtSetArg (av [ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
584 XtSetArg (av [ac], XmNleftAttachment, XmATTACH_FORM); ac++;
585 XtSetArg (av [ac], XmNrightAttachment, XmATTACH_FORM); ac++;
586 preferences_form = XmCreateForm (parent, "preferencesForm", av, ac);
587 XtManageChild (preferences_form);
591 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
592 timeout_label = XmCreateLabelGadget (preferences_form, "timeoutLabel",
595 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
596 cycle_label = XmCreateLabelGadget (preferences_form, "cycleLabel",
599 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
600 fade_seconds_label = XmCreateLabelGadget (preferences_form,
601 "fadeSecondsLabel", av, ac);
603 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
604 fade_ticks_label = XmCreateLabelGadget (preferences_form, "fadeTicksLabel",
607 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
608 lock_label = XmCreateLabelGadget (preferences_form, "lockLabel", av, ac);
610 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
611 passwd_label = XmCreateLabelGadget (preferences_form, "passwdLabel", av, ac);
613 timeout_text = XmCreateTextField (preferences_form, "timeoutText", av, ac);
614 cycle_text = XmCreateTextField (preferences_form, "cycleText", av, ac);
615 fade_text = XmCreateTextField (preferences_form, "fadeSecondsText", av, ac);
616 fade_ticks_text = XmCreateTextField (preferences_form, "fadeTicksText",
618 lock_timeout_text = XmCreateTextField (preferences_form, "lockText",
620 passwd_timeout_text = XmCreateTextField (preferences_form, "passwdText",
622 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
623 verbose_toggle = XmCreateToggleButtonGadget (preferences_form,
624 "verboseToggle", av, ac);
626 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
627 install_cmap_toggle = XmCreateToggleButtonGadget (preferences_form,
628 "cmapToggle", av, ac);
630 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
631 fade_toggle = XmCreateToggleButtonGadget (preferences_form, "fadeToggle",
634 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
635 unfade_toggle = XmCreateToggleButtonGadget (preferences_form, "unfadeToggle",
638 XtSetArg(av[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
639 lock_toggle = XmCreateToggleButtonGadget (preferences_form, "lockToggle",
642 hr = XmCreateSeparatorGadget (preferences_form, "separator", av, ac);
644 prefs_done = XmCreatePushButtonGadget (preferences_form, "OK", av, ac);
645 prefs_cancel = XmCreatePushButtonGadget (preferences_form, "Cancel", av, ac);
647 XtVaSetValues (timeout_label,
648 XmNtopAttachment, XmATTACH_FORM,
650 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
651 XmNbottomWidget, timeout_text,
652 XmNleftAttachment, XmATTACH_FORM,
654 XmNrightAttachment, XmATTACH_WIDGET,
656 XmNrightWidget, timeout_text,
659 XtVaSetValues (cycle_label,
660 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
662 XmNtopWidget, cycle_text,
663 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
665 XmNbottomWidget, cycle_text,
666 XmNleftAttachment, XmATTACH_FORM,
668 XmNrightAttachment, XmATTACH_WIDGET,
670 XmNrightWidget, cycle_text,
673 XtVaSetValues (fade_seconds_label,
674 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
676 XmNtopWidget, fade_text,
677 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
679 XmNbottomWidget, fade_text,
680 XmNleftAttachment, XmATTACH_FORM,
682 XmNrightAttachment, XmATTACH_WIDGET,
684 XmNrightWidget, fade_text,
687 XtVaSetValues (fade_ticks_label,
688 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
690 XmNtopWidget, fade_ticks_text,
691 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
693 XmNbottomWidget, fade_ticks_text,
694 XmNleftAttachment, XmATTACH_FORM,
696 XmNrightAttachment, XmATTACH_WIDGET,
698 XmNrightWidget, fade_ticks_text,
701 XtVaSetValues (lock_label,
702 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
704 XmNtopWidget, lock_timeout_text,
705 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
707 XmNbottomWidget, lock_timeout_text,
708 XmNleftAttachment, XmATTACH_FORM,
710 XmNrightAttachment, XmATTACH_WIDGET,
712 XmNrightWidget, lock_timeout_text,
715 XtVaSetValues (passwd_label,
716 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
718 XmNtopWidget, passwd_timeout_text,
719 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
721 XmNbottomWidget, passwd_timeout_text,
722 XmNleftAttachment, XmATTACH_FORM,
724 XmNrightAttachment, XmATTACH_WIDGET,
726 XmNrightWidget, passwd_timeout_text,
729 XtVaSetValues (timeout_text,
730 XmNtopAttachment, XmATTACH_FORM,
732 XmNleftAttachment, XmATTACH_FORM,
736 XtVaSetValues (cycle_text,
737 XmNtopAttachment, XmATTACH_WIDGET,
739 XmNtopWidget, timeout_text,
740 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
742 XmNleftWidget, timeout_text,
745 XtVaSetValues (fade_text,
746 XmNtopAttachment, XmATTACH_WIDGET,
748 XmNtopWidget, cycle_text,
749 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
751 XmNleftWidget, cycle_text,
754 XtVaSetValues (fade_ticks_text,
755 XmNtopAttachment, XmATTACH_WIDGET,
757 XmNtopWidget, fade_text,
758 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
760 XmNleftWidget, fade_text,
763 XtVaSetValues (lock_timeout_text,
764 XmNtopAttachment, XmATTACH_WIDGET,
766 XmNtopWidget, fade_ticks_text,
767 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
769 XmNleftWidget, fade_ticks_text,
772 XtVaSetValues (passwd_timeout_text,
773 XmNtopAttachment, XmATTACH_WIDGET,
775 XmNtopWidget, lock_timeout_text,
776 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
778 XmNleftWidget, lock_timeout_text,
781 XtVaSetValues (verbose_toggle,
782 XmNtopAttachment, XmATTACH_FORM,
784 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
786 XmNbottomWidget, timeout_text,
787 XmNleftAttachment, XmATTACH_WIDGET,
789 XmNleftWidget, timeout_text,
790 XmNrightAttachment, XmATTACH_FORM,
794 XtVaSetValues (install_cmap_toggle,
795 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
797 XmNtopWidget, cycle_text,
798 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
800 XmNbottomWidget, cycle_text,
801 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
803 XmNleftWidget, verbose_toggle,
804 XmNrightAttachment, XmATTACH_FORM,
808 XtVaSetValues (fade_toggle,
809 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
811 XmNtopWidget, fade_text,
812 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
814 XmNbottomWidget, fade_text,
815 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
817 XmNleftWidget, install_cmap_toggle,
818 XmNrightAttachment, XmATTACH_FORM,
822 XtVaSetValues (unfade_toggle,
823 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
825 XmNtopWidget, fade_ticks_text,
826 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
828 XmNbottomWidget, fade_ticks_text,
829 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
831 XmNleftWidget, fade_toggle,
832 XmNrightAttachment, XmATTACH_FORM,
836 XtVaSetValues (lock_toggle,
837 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
839 XmNtopWidget, lock_timeout_text,
840 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
842 XmNbottomWidget, lock_timeout_text,
843 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
845 XmNleftWidget, unfade_toggle,
846 XmNrightAttachment, XmATTACH_FORM,
851 XmNtopWidget, passwd_timeout_text,
852 XmNbottomAttachment, XmATTACH_FORM,
854 XmNleftAttachment, XmATTACH_FORM,
855 XmNrightAttachment, XmATTACH_FORM,
858 XtVaSetValues (prefs_done,
859 XmNleftAttachment, XmATTACH_FORM,
860 XmNbottomAttachment, XmATTACH_FORM,
862 XtVaSetValues (prefs_cancel,
863 XmNrightAttachment, XmATTACH_FORM,
864 XmNbottomAttachment, XmATTACH_FORM,
867 XmNbottomAttachment, XmATTACH_WIDGET,
868 XmNbottomWidget, prefs_done,
872 children[ac++] = timeout_label;
873 children[ac++] = cycle_label;
874 children[ac++] = fade_seconds_label;
875 children[ac++] = fade_ticks_label;
876 children[ac++] = lock_label;
877 children[ac++] = passwd_label;
878 children[ac++] = timeout_text;
879 children[ac++] = cycle_text;
880 children[ac++] = fade_text;
881 children[ac++] = fade_ticks_text;
882 children[ac++] = lock_timeout_text;
883 children[ac++] = passwd_timeout_text;
884 children[ac++] = verbose_toggle;
885 children[ac++] = install_cmap_toggle;
886 children[ac++] = fade_toggle;
887 children[ac++] = unfade_toggle;
888 children[ac++] = lock_toggle;
891 XtManageChildren(children, ac);
894 XtManageChild (prefs_done);
895 XtManageChild (prefs_cancel);
897 XtManageChild (preferences_form);
899 XtVaSetValues (preferences_form,
900 XmNleftAttachment, XmATTACH_FORM,
901 XmNrightAttachment, XmATTACH_FORM,
902 XmNtopAttachment, XmATTACH_FORM,
903 XmNbottomAttachment, XmATTACH_FORM,
906 return preferences_form;