1 /*
2  *  create the interface
3  *
4  *  RCS:
5  *      $Revision$
6  *      $Date$
7  *
8  *  Security:
9  *      Unclassified
10  *
11  *  Description:
12  *      text
13  *
14  *  Input Parameters:
15  *      type    identifier  description
16  *
17  *      text
18  *
19  *  Output Parameters:
20  *      type    identifier  description
21  *
22  *      text
23  *
24  *  Return Values:
25  *      value   description
26  *
27  *  Side Effects:
28  *      text
29  *
30  *  Limitations and Comments:
31  *      text
32  *
33  *  Development History:
34  *      who                 when        why
35  *      muquit@semcor.com   04-Sep-95   first cut
36  */
37 
38 #include "xhead.h"
39 #include "mxkill.h"
40 #include "menu.h"
41 #include "regex.h"
42 
43 #include "converter.h"
44 #include "bitmaps.h"
45 #include "mxkicon.xbm"
46 
47 static Pixmap
48     kpix[6];
49 
50 static Widget
51         aboutdW,
52         xpsheadtextW,
53         xpslistW,
54         xpstextW,
55         xzapPbW,
56         xregextextW;
57 
58 static Widget
59     SmsgtextW;
60 
CreateKillPixmaps(fg,bg)61 void CreateKillPixmaps(fg,bg)
62 Pixel
63     fg,
64     bg;
65 {
66      int
67         i;
68 
69 
70      for (i=0; i < 6; i++)
71         kpix[i] = (Pixmap) NULL;
72 
73      /*
74      ** terminate (15)
75      */
76      kpix[0]=XCreatePixmapFromBitmapData(Gdisplay,
77         Grootwindow,
78         skull_bits,
79         skull_width,
80         skull_height,
81         fg,
82         bg,
83         Gdepth);
84 
85      /*
86      ** quit (3)
87      */
88 
89      kpix[1]=XCreatePixmapFromBitmapData(Gdisplay,
90         Grootwindow,
91         skull1_bits,
92         skull1_width,
93         skull1_height,
94         fg,
95         bg,
96         Gdepth);
97 
98      /*
99      ** kill (9)
100      */
101 
102      kpix[2]=XCreatePixmapFromBitmapData(Gdisplay,
103         Grootwindow,
104         skull2_bits,
105         skull2_width,
106         skull2_height,
107         fg,
108         bg,
109         Gdepth);
110 
111      /*
112      ** hangup (1)
113      */
114 
115      kpix[3]=XCreatePixmapFromBitmapData(Gdisplay,
116         Grootwindow,
117         phone_bits,
118         phone_width,
119         phone_height,
120         fg,
121         bg,
122         Gdepth);
123 
124      /*
125      **  stop (17)
126      */
127 
128      kpix[4]=XCreatePixmapFromBitmapData(Gdisplay,
129         Grootwindow,
130         stillman_bits,
131         stillman_width,
132         stillman_height,
133         fg,
134         bg,
135         Gdepth);
136 
137      /*
138      ** continue (19)
139      */
140 
141      kpix[5]=XCreatePixmapFromBitmapData(Gdisplay,
142         Grootwindow,
143         runman_bits,
144         runman_width,
145         runman_height,
146         fg,
147         bg,
148         Gdepth);
149 
150     for(i=0; i < 6; i++)
151     {
152         if (kpix[i] == (Pixmap) NULL)
153             Error("Unable to create kill pixmaps",(char *) NULL);
154     }
155 }
156 
157 
CreateMainWindow(parent)158 void CreateMainWindow(parent)
159 Widget
160     parent;
161 {
162     Arg
163         args[20];
164 
165     int
166         n;
167 
168     Widget
169         xmainwW,
170         xmenubarW,
171         xhelpW,
172         xformW,
173         xpsPbW,
174         xframeW,
175         xrcW,
176         xregexformW,
177         xregexLabW,
178         xregexframeW,
179         xregexrcW;
180 
181     Widget
182         msgframeW,
183         msgrcW;
184 
185     extern MenuItem
186         file_items[],
187         signal_items[],
188         ps_items[],
189         help_items[];
190 
191     Pixel
192         fg,
193         bg;
194 
195     Widget
196         vsbW,
197         hsbW;
198 
199     Pixmap
200         pix=(Pixmap) NULL;
201     /*
202     ** create the main window
203     */
204     xmainwW=XtVaCreateWidget("xmainw",
205         xmMainWindowWidgetClass,parent,
206         NULL);
207 
208     XtVaGetValues(xmainwW,
209         XmNforeground,&fg,
210         XmNbackground,&bg,
211         NULL);
212     CreateKillPixmaps(fg,bg);
213 
214     /*
215     ** create menubar
216     */
217     xmenubarW=XmCreateMenuBar(xmainwW,"menuBar",NULL,0);
218     (void) MBuildPulldownMenu(xmenubarW,"File",'F',file_items);
219     (void) MBuildPulldownMenu(xmenubarW,"Signal",'S',signal_items);
220     (void) MBuildPulldownMenu(xmenubarW,"ps Options",'O',ps_items);
221     xhelpW=MBuildPulldownMenu(xmenubarW,"Help",'H',help_items);
222     XtVaSetValues(xmenubarW,
223         XmNmenuHelpWidget,
224         xhelpW,
225         NULL);
226 
227 
228     /*
229     ** create a form
230     */
231     xformW=XtVaCreateWidget("xform",
232         xmFormWidgetClass, xmainwW,
233         NULL);
234 
235 
236     /*
237     ** create a frame
238     */
239     xframeW=XtVaCreateManagedWidget("xframe",
240         xmFrameWidgetClass,   xformW,
241         XmNtopAttachment,     XmATTACH_FORM,
242         XmNleftAttachment,    XmATTACH_FORM,
243         XmNrightAttachment,   XmATTACH_FORM,
244         NULL);
245     /*
246     ** create a rc on frame
247     */
248     xrcW=XtVaCreateWidget("xrc",
249         xmRowColumnWidgetClass, xframeW,
250         XmNorientation,XmHORIZONTAL,
251         NULL);
252 
253     /*
254     ** create zap pushbutton
255     */
256     xzapPbW=XtVaCreateManagedWidget("xzappb",
257         xmPushButtonWidgetClass,    xrcW,
258         NULL);
259     SetKillPixmap(9);
260 
261     XtAddCallback(xzapPbW,XmNactivateCallback,
262         (XtCallbackProc) KillProcessCb,NULL);
263 
264     /*
265     ** create the ps pushbutton
266     */
267     xpsPbW=XtVaCreateManagedWidget("xpspb",
268         xmPushButtonWidgetClass,    xrcW,
269         NULL);
270 
271     XtAddCallback(xpsPbW, XmNactivateCallback,
272         (XtCallbackProc) PsCb, (XtPointer) NULL);
273 
274     pix=XCreatePixmapFromBitmapData(Gdisplay,
275         Grootwindow,
276         ps_bits,
277         ps_width,
278         ps_height,
279         fg,
280         bg,
281         Gdepth);
282 
283     if(pix != (Pixmap) NULL)
284         XtVaSetValues(xpsPbW,
285             XmNlabelType, XmPIXMAP,
286             XmNlabelPixmap, pix,
287             NULL);
288 
289     /*
290     ** create text widget for ps options
291     */
292     xpstextW=XtVaCreateManagedWidget("xpstext",
293         xmTextFieldWidgetClass, xrcW,
294         NULL);
295     XmTextSetString(xpstextW,GpsdefOption);
296     XtAddCallback(xpstextW,XmNactivateCallback,
297         (XtCallbackProc) psOptionTextCb, NULL);
298 
299     /*
300     ** create the text widget to put psheader
301     */
302     xpsheadtextW=XtVaCreateManagedWidget("xpsheadtext",
303         xmTextWidgetClass, xformW,
304         XmNleftAttachment,    XmATTACH_FORM,
305         XmNtopAttachment,     XmATTACH_WIDGET,
306         XmNtopWidget,         xframeW,
307         XmNrightAttachment,   XmATTACH_FORM,
308         NULL);
309 
310 
311     /*
312     ** create the
313     /*
314     ** create another form
315     */
316     xregexformW=XtVaCreateWidget("xregform",
317         xmFormWidgetClass, xformW,
318         XmNleftAttachment,  XmATTACH_FORM,
319         XmNbottomAttachment,XmATTACH_FORM,
320         XmNrightAttachment, XmATTACH_FORM,
321         NULL);
322     /*
323     ** create a regex frame
324     */
325     xregexframeW=XtVaCreateManagedWidget("xwcframe",
326         xmFrameWidgetClass,xregexformW,
327         XmNtopAttachment, XmATTACH_FORM,
328         XmNleftAttachment,XmATTACH_FORM,
329         XmNrightAttachment, XmATTACH_FORM,
330         XmNbottomAttachment, XmATTACH_FORM,
331         NULL);
332     /*
333     ** create a rc on the form below list widget
334     */
335     xregexrcW=XtVaCreateWidget("xwcrc",
336         xmRowColumnWidgetClass,xregexframeW,
337         XmNorientation,XmHORIZONTAL,
338         NULL);
339 
340     /*
341     ** create the regex label
342     */
343     xregexLabW=XtVaCreateManagedWidget("xwclab",
344         xmLabelWidgetClass,xregexrcW,
345         NULL);
346 
347     /*
348     ** create the regex entering text widget
349     */
350     xregextextW=XtVaCreateManagedWidget("xwctext",
351         xmTextFieldWidgetClass,xregexrcW,
352         NULL);
353     XtAddCallback(xregextextW,XmNactivateCallback,
354         (XtCallbackProc) PatternMatchCb,(XtPointer) NULL);
355 
356     /*
357     ** create the message frame -------------------------------
358     */
359     msgframeW=XtVaCreateManagedWidget("msgframew",
360          xmFrameWidgetClass,xformW,
361          XmNleftAttachment,  XmATTACH_FORM,
362          XmNrightAttachment, XmATTACH_FORM,
363          XmNbottomAttachment,XmATTACH_WIDGET,
364          XmNbottomWidget,xregexformW,
365          NULL);
366 
367     /*
368     ** creaet the msgrcW
369     */
370     msgrcW=XtVaCreateWidget("msgrcw",
371         xmRowColumnWidgetClass,msgframeW,
372         NULL);
373     /*
374     ** crate the msgtext w
375     */
376     SmsgtextW=XtVaCreateManagedWidget("msgtextw",
377         xmTextWidgetClass,msgrcW,
378         XmNeditable,                False,
379         XmNcursorPositionVisible,   False,
380         XmNshadowThickness,         0,
381         NULL);
382 
383     /*
384     ** create the ps list W -----------------------------------
385     */
386     n=0;
387     XtSetArg(args[n], XmNtopAttachment,XmATTACH_WIDGET);        n++;
388     XtSetArg(args[n], XmNtopWidget,xpsheadtextW);               n++;
389     XtSetArg(args[n], XmNleftAttachment,XmATTACH_FORM);         n++;
390     XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM);        n++;
391     XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET);     n++;
392     /*
393     XtSetArg(args[n], XmNbottomWidget,xregexformW);             n++;
394     */
395     XtSetArg(args[n], XmNbottomWidget,msgframeW);             n++;
396     XtSetArg(args[n], XmNbottomOffset, 5);                      n++;
397     /*
398     XtSetArg(args[n], XmNscrollBarPlacement,XmBOTTOM_RIGHT);    n++;
399     */
400     XtSetArg(args[n], XmNlistSizePolicy,XmCONSTANT);            n++;
401     XtSetArg(args[n], XmNselectionPolicy,XmMULTIPLE_SELECT);    n++;
402     XtSetArg(args[n], XmNlistMarginWidth, 2);                   n++;
403     XtSetArg(args[n], XmNlistMarginHeight, 2);                  n++;
404 
405     xpslistW=XmCreateScrolledList(xformW,"xpslist",
406         args,n);
407 
408     /*
409     ** set the color of the scrollbar
410     */
411     XtVaGetValues (XtParent(xpslistW),
412         XmNverticalScrollBar, &vsbW,
413         XmNhorizontalScrollBar, &hsbW,
414         NULL);
415 
416     bg=(Pixel) AllocateNamedColor(Gdisplay,"#b2c3df");
417     SetScrollbarColors(vsbW,hsbW,bg);
418 
419     /*
420     ** Manage Widgets
421     */
422     XtManageChild(msgrcW);
423     XtManageChild(xpslistW);
424     XtManageChild(xregexrcW);
425     XtManageChild(xregexformW);
426     XtManageChild (xrcW);
427     XtManageChild (xformW);
428     XtManageChild(xmenubarW);
429     XtManageChild(xmainwW);
430 }
431 
432 /*
433 ** Null callback
434 */
NullCb(widget,client_data,call_data)435 void NullCb(widget,client_data,call_data)
436 Widget
437     widget;
438 XtPointer
439     client_data,
440     call_data;
441 {
442     (void) fprintf (stderr," I am Null callback, I do nothing!\n");
443 }
444 
445 /*
446 ** Quit callback
447 */
QuitCb(widget,client_data,call_data)448 void QuitCb(widget,client_data,call_data)
449 Widget
450     widget;
451 XtPointer
452     client_data,
453     call_data;
454 {
455     FreeKillPixmaps();
456     exit(0);
457 }
458 
459 /*
460 ** set the signal number from Signal menu
461 */
462 
SignalSetCb(widget,client_data,call_data)463 void SignalSetCb(widget,client_data,call_data)
464 Widget
465     widget;
466 XtPointer
467     client_data,
468     call_data;
469 {
470     int
471         sig_no=(int) client_data;
472     register int
473         i;
474 
475     Gsignal_no=sig_no;
476 
477     for (i=0; i < 6; i++)
478     {
479         XtVaSetValues(Gtoggle_menuW[i],
480             XmNset, False,
481             NULL);
482     }
483     XtVaSetValues(widget,
484         XmNset, True,
485         NULL);
486 
487     SetKillPixmap(Gsignal_no);
488 #ifdef DEBUG
489     (void) fprintf (stderr," Signal: %d\n",Gsignal_no);
490 #endif
491 }
492 
FreeKillPixmaps()493 void FreeKillPixmaps()
494 {
495     int
496         i;
497 
498     for (i=0; i < 6; i++)
499     {
500         if (kpix[i] != (Pixmap) NULL)
501             XFreePixmap(Gdisplay,kpix[i]);
502     }
503 }
504 
SetKillPixmap(sig_no)505 void SetKillPixmap(sig_no)
506 int
507     sig_no;
508 {
509     switch(sig_no)
510     {
511         case 15:
512         {
513             SetPixmap(kpix[0],xzapPbW);
514             break;
515         }
516 
517         case 3:
518         {
519             SetPixmap(kpix[1],xzapPbW);
520             break;
521         }
522 
523         case 9:
524         {
525             SetPixmap(kpix[2],xzapPbW);
526             break;
527         }
528 
529         case 1:
530         {
531             SetPixmap(kpix[3],xzapPbW);
532             break;
533         }
534 
535         case 17:
536         {
537             SetPixmap(kpix[4],xzapPbW);
538             break;
539         }
540 
541         case 19:
542         {
543             SetPixmap(kpix[5],xzapPbW);
544             break;
545         }
546     }
547 }
548 
SetPixmap(pixm,widget)549 void SetPixmap(pixm,widget)
550 Pixmap
551     pixm;
552 Widget
553     widget;
554 {
555     XtVaSetValues(widget,
556         XmNlabelType, XmPIXMAP,
557         XmNlabelPixmap,pixm,
558         NULL);
559 }
560 
561 
562 /*
563 ** ps pushbutton callback
564 */
565 
PsCb(widget,client_data,call_data)566 void PsCb(widget,client_data,call_data)
567 Widget
568     widget;
569 XtPointer
570     client_data,
571     call_data;
572 {
573     char
574         *psops;
575 
576     extern char
577         *psheader;
578 
579     unsigned int
580         status;
581     char
582         commandbuf[1024];
583 
584     SetbusyCursorState(GtoplevelW,1);
585     psops=GetpsOptions();
586     *commandbuf='\0';
587 
588     (void) sprintf(commandbuf,"%s -%s",GpsCommand,GpsdefOption);
589     if (psops != (char *) NULL)
590         (void) sprintf(commandbuf,"%s -%s",GpsCommand,psops);
591 
592     status=GetpsInfo(commandbuf);
593 
594 #ifdef DEBUG
595     (void) fprintf (stderr," ps command: %s\n",commandbuf);
596     (void) fprintf (stderr," ps status: %d\n",status);
597     (void) fprintf (stderr," Gmaxline: %d\n", Gmaxline);
598     (void) fprintf (stderr," psheader:%s\n",psheader);
599 #endif
600     if (status)
601     {
602         if (psheader != (char *) NULL)
603             XmTextSetString(xpsheadtextW,psheader);
604         PutListOnScreen();
605     }
606     SetbusyCursorState(GtoplevelW,0);
607     WriteMessage("",0);
608 }
609 
610 /*
611 ** see if there is any ps option
612 */
GetpsOptions()613 char *GetpsOptions()
614 {
615     char
616         *s=(char *) NULL;
617 
618     s=XmTextGetString(xpstextW);
619 
620     if ((int) strlen(s) != 0)
621         return (s);
622 
623 return ((char *) NULL);
624 }
625 
626 /*
627 ** callback for the ps option text widget
628 **
629 **  line was getting freed, actually there was no need for it,8/30/1997
630 */
631 
psOptionTextCb(widget,client_data,call_data)632 void psOptionTextCb(widget,client_data,call_data)
633 Widget
634     widget;
635 XtPointer
636     client_data,
637     call_data;
638 {
639     PsCb((Widget)NULL,(XtPointer)NULL,(XtPointer)NULL);
640 }
641 
PutListOnScreen()642 void PutListOnScreen()
643 {
644     extern int
645         Gmaxline;
646 
647     extern char
648         *lines[];
649 
650     XmString
651         *xmtable;
652 
653     register int
654         i;
655 
656     int
657         n;
658     n=Gmaxline;
659     xmtable=(XmString *) calloc(n,sizeof(XmString));
660     for (i=0; i < Gmaxline; i++)
661     {
662         xmtable[i]=XmStringCreateSimple(lines[i]);
663     }
664     XtUnmapWidget(xpslistW);
665     XmListDeleteAllItems(xpslistW);
666     XmListAddItems(xpslistW,xmtable,n,0);
667     XtMapWidget(xpslistW);
668 
669     for (i=0; i < n; i++)
670         XmStringFree (xmtable[i]);
671 }
672 
673 /*
674 ** kill callback
675 */
676 
KillProcessCb(widget,client_data,call_data)677 void KillProcessCb(widget,client_data,call_data)
678 Widget
679     widget;
680 XtPointer
681     client_data,
682     call_data;
683 {
684     GetListPositions();
685 }
686 
687 /*
688 ** multiple selection callback
689 */
690 
GetListPositions()691 void GetListPositions()
692 {
693     Boolean
694         status;
695 
696     int
697         *position_list;
698 
699     int
700         position_count;
701 
702     extern char
703         *lines[];
704     extern int
705         pidcol;
706     int
707         i;
708 
709     int
710         rc;
711     int
712         pid;
713 
714     register char
715         *p;
716 
717     status=XmListGetSelectedPos(xpslistW,&position_list,&position_count);
718 
719     if (status)
720     {
721         for(i=0; i < position_count; i++)
722         {
723             p=lines[position_list[i]-1];
724             p += pidcol;
725 
726             rc=sscanf(p,"%d",&pid);
727             if (rc != 1)
728             {
729                 XBell(Gdisplay,0);
730                  (void) fprintf (stderr," Problem finding PID\n");
731                  break;
732             }
733             if (pid > 0)
734             {
735                 rc=kill(pid,Gsignal_no);
736                 if (rc != 0)
737                     (void) fprintf (stderr," Problem killing pid: %d\n",pid);
738             }
739         }
740         (void) free ((char *) position_list);
741         PsCb((Widget) NULL, (XtPointer) NULL, (XtPointer) NULL);
742     }
743     else
744         XBell(Gdisplay,0);
745 
746 }
747 
748 /*
749 ** callback routine for pattern match
750 */
PatternMatchCb(widget,client_data,call_data)751 void PatternMatchCb(widget,client_data,call_data)
752 Widget
753     widget;
754 XtPointer
755     client_data,
756     call_data;
757 {
758     Widget
759         listw=xpslistW;
760 
761     char
762         *s_text,
763         *text,
764         *newtext,
765         *exp;
766 
767     XmString
768         *strlist,
769         *selectlist;
770 
771     int
772         cnt,
773         matched,
774         j;
775 
776     char
777         buf[128];
778 
779     j=0;
780     selectlist=(XmString *) NULL;
781     newtext=XmTextFieldGetString(widget);
782 
783     if (!newtext || !*newtext)
784     {
785         XtFree(newtext);
786         return;
787     }
788 
789 
790     s_text=XtNewString(newtext);
791 
792     /*
793     ** compile expression into pattern matching library
794     */
795 
796     if (exp=re_comp(newtext))
797     {
798         (void) fprintf (stderr," Error with re_comp(%s): %s\n",
799             newtext,exp);
800         XtFree(newtext);
801         return;
802     }
803 
804     XtVaGetValues(listw,
805         XmNitemCount, &cnt,
806         XmNitems, &strlist,
807         NULL);
808 
809     while(cnt--)
810     {
811         if (!XmStringGetLtoR(strlist[cnt],XmFONTLIST_DEFAULT_TAG,&text))
812             break;
813 
814         matched=re_exec(text) > 0;
815         if(matched)
816         {
817             selectlist=(XmString *) XtRealloc((XmString *) selectlist,
818                 (j+1)*(sizeof(XmString *)));
819 
820             selectlist[j++]=XmStringCopy(strlist[cnt]);
821         }
822         XtFree(text);
823     }
824 
825     XtFree(newtext);
826     XtVaSetValues(listw,
827         XmNselectedItems,     selectlist,
828         XmNselectedItemCount, j,
829         NULL);
830 
831     if (j)
832     {
833         if (j > 1)
834         (void) sprintf(buf,"%d matching processes found for string: %s",j,s_text);
835         else
836         (void) sprintf(buf,"%d matching process found for string: %s",j,s_text);
837 
838         WriteMessage(buf,0);
839     }
840     else
841     {
842         (void) sprintf(buf,"No matching process found for string: %s",s_text);
843         WriteMessage(buf,1);
844     }
845     while (j--)
846         XmStringFree(selectlist[j]);
847 
848     XtFree(s_text);
849     /*XmTextFieldSetString(widget,"");*/
850 }
851 
psOptionCb(widget,client_data,call_data)852 void psOptionCb(widget,client_data,call_data)
853 Widget
854     widget;
855 XtPointer
856     client_data,
857     call_data;
858 {
859     switch((int) client_data)
860     {
861         case 0:
862         {
863             XmTextSetString(xpstextW,GpsdefOption);
864             PsCb((Widget)NULL,(XtPointer)NULL,(XtPointer)NULL);
865             break;
866         }
867         case 1:
868         {
869             XmTextSetString(xpstextW,GpsAllOption);
870             PsCb((Widget)NULL,(XtPointer)NULL,(XtPointer)NULL);
871             break;
872         }
873         case 2:
874         {
875             XmTextSetString(xpstextW,GpsAllbyUserOption);
876             PsCb((Widget)NULL,(XtPointer)NULL,(XtPointer)NULL);
877             break;
878         }
879         case 3:
880         {
881             XmTextSetString(xpstextW,GpsAllbyPidOption);
882             PsCb((Widget)NULL,(XtPointer)NULL,(XtPointer)NULL);
883             break;
884         }
885     }
886 }
887 
888 
889 /*
890  *  CreateAboutD - crea the about dialog
891  *
892  *  RCS:
893  *      $Revision$
894  *      $Date$
895  *
896  *  Security:
897  *      Unclassified
898  *
899  *  Description:
900  *      text
901  *
902  *  Input Parameters:
903  *      type    identifier  description
904  *
905  *      text
906  *
907  *  Output Parameters:
908  *      type    identifier  description
909  *
910  *      text
911  *
912  *  Return Values:
913  *      value   description
914  *
915  *  Side Effects:
916  *      text
917  *
918  *  Limitations and Comments:
919  *      text
920  *
921  *  Development History:
922  *      who                 when        why
923  *      muquit@semcor.com   02-Sep-95   first cut
924  */
925 
926 
927 
CreateAboutD(parent)928 void CreateAboutD(parent)
929 Widget
930     parent;
931 {
932     Arg
933         args[10];
934 
935     int
936         n;
937 
938     XmString
939         xmstr;
940 
941     Pixmap
942         apix=(Pixmap) NULL;
943 
944     Pixel
945         fg,
946         bg;
947 
948     XtAppContext app=XtWidgetToApplicationContext(GtoplevelW);
949     XitAddXmStringConverter(app);
950 
951     xmstr=XmStringCreateSimple("About mdgclock");
952     n=0;
953     XtSetArg (args[n], XmNautoUnmanage, True); n++;
954     XtSetArg (args[n], XmNdialogStyle, XmDIALOG_MODELESS); n++;
955     XtSetArg (args[n], XmNdialogTitle, xmstr);      n++;
956 
957     aboutdW=XmCreateInformationDialog(parent,"aboutd",
958         args,n);
959 
960     XmStringFree(xmstr);
961 
962     XtUnmanageChild(XmMessageBoxGetChild(aboutdW,XmDIALOG_HELP_BUTTON));
963     XtUnmanageChild(XmMessageBoxGetChild(aboutdW,XmDIALOG_CANCEL_BUTTON));
964 
965     XtVaGetValues(aboutdW,
966         XmNforeground,&fg,
967         XmNbackground,&bg,
968         NULL);
969 
970     apix=XCreatePixmapFromBitmapData(Gdisplay,
971         Grootwindow,
972         mxkicon_bits,
973         mxkicon_width,
974         mxkicon_height,
975         bg,
976         fg,
977         Gdepth);
978 
979 
980     if (apix != (Pixmap) NULL)
981         XtVaSetValues(aboutdW,
982             XmNsymbolPixmap,apix,
983             NULL);
984 }
985 
AboutdCb(widget,client_data,call_data)986 void AboutdCb(widget,client_data,call_data)
987 Widget
988     widget;
989 XtPointer
990     client_data,
991     call_data;
992 {
993         if (!XtIsManaged(aboutdW))
994         {
995             XtManageChild(aboutdW);
996             XtVaSetValues(aboutdW,
997                 XmNx, ((GdisplayWidth>>1)-50),
998                 XmNy, ((GdisplayHeight>>1)-50),
999                 NULL);
1000         }
1001 }
1002 /*
1003 **  WriteMessage()
1004 **  writes status message to the text widget above the regex label
1005 **
1006 **  RCS
1007 **      $Revision$
1008 **      $Date$
1009 **  Return Values:
1010 **      none
1011 **
1012 **  Parameters:
1013 **      message     the message to write
1014 *       bell        1 for beep, 0 for quiet
1015 **
1016 **  Side Effects:
1017 **      none
1018 **
1019 **  Limitations and Comments:
1020 **      none
1021 **
1022 **  Development History:
1023 **      who                  when           why
1024 **      ma_muquit@fccc.edu   Aug-30-1997    first cut
1025 */
1026 
WriteMessage(message,bell)1027 void WriteMessage(message,bell)
1028 char
1029     *message;
1030 int
1031     bell;
1032 {
1033     if (bell == 1)
1034         XBell(Gdisplay,0);
1035     XmTextSetString(SmsgtextW,message);
1036     XmUpdateDisplay(SmsgtextW);
1037 }
1038