Xref: utzoo comp.sys.hp:3845 comp.windows.x:16129 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!trwind!venice!ries From: ries@venice.SEDD.TRW.COM (Marc Ries) Newsgroups: comp.sys.hp,comp.windows.x Subject: Re: Programatically Dispensing with MWM Decorations Message-ID: <216@venice.SEDD.TRW.COM> Date: 22 Dec 89 00:36:30 GMT Reply-To: ries@venice.sedd.trw.com (Marc Ries) Distribution: usa Organization: TRW Lines: 80 [In response to my plea for help, the following code was emailed to me. Unfortunately, my mailer doesn't recognize the senders email address so I could not respond directly. I have left out the orig. senders name. Thanks to the sender for at least responding 8-)] The problem is, the code doesn't work, at least on our HP 360's running HP MOTIF under HPUX 7.0. I ran the following code, and on our system, I still got a pushbutton widget with a full set of MWM decorations around it?!?!? Is it HP MOTIF or me or ???? ================================================================ /* mwm3.c - change mwm borders and frames. Based on pushb.c */ #include #include #include #include #include #include #include #include void Exit (widget, closure, call_data) Widget widget; caddr_t closure, call_data; { printf ("About to Exit\n"); exit(); } main (argc, argv) int argc; char *argv[]; { Widget toplevel, pushb; Arg arglist[10]; int n; toplevel = XtInitialize(argv[0], "Motif", NULL, 0, &argc, argv); pushb = XmCreatePushButton (toplevel, "Close", NULL,0); XtManageChild (pushb); XtAddCallback (pushb, XmNactivateCallback, Exit, NULL); XtRealizeWidget (toplevel); { Display *display = XtDisplay (toplevel); Atom Motif_atom = XmInternAtom (display, _XA_MWM_HINTS, False); PropMwmHints data; data.flags = MWM_HINTS_DECORATIONS; /* leave out resize handles, title, system menu, zoom */ data.decorations = MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MINIMIZE; /* property will stay there, present for when Mwm finally runs */ XChangeProperty (display, XtWindow(toplevel), Motif_atom, Motif_atom, 32, PropModeReplace, (unsigned char *) &data, PROP_MOTIF_WM_HINTS_ELEMENTS); } XtMainLoop(); } ================================================================ Am I missing something or is HP Motif screwed up? In either case, I typed in the above code verbatim and ran it and none of the border attributes changed (ie, I still had a push-button widget appear with a full MWM border decorations). Thanks, Marc Ries (ries@venice) -- Marc Ries ries@venice.sedd.trw.com (ARPA) somewhere!trwind!venice!ries (UUCP) #include