Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!ucbvax!Inference.COM!dfc From: dfc@Inference.COM (Deborah Catalano) Newsgroups: comp.windows.x.motif Subject: Motif window decorations under olwm Message-ID: <9105081852.AA00766@quaestor.Inference.COM> Date: 8 May 91 18:52:37 GMT References: <9105061720.AA06451@trifid> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 88 > > > Under mwm and twm, the window decorations, including title, do appear. What > > can I do so that they will also show under olwm? > A closer look at olwm reveals that it is looking at an _OL_WIN_ATTR window property to set the decorations (see pages 70-72 of OLIT Widget Set Programmer's Guide). I was going to set the "menu_type" atom to _OL_MENU_LIMITED for all of our popups but I have been working on a bigger problem. None of our option menus work correctly they popup but then pop right back down. I have finally solved this problem for our application. I had to set the _OL_WA_WIN_TYPE property to _OL_WT_OTHER (which tells the window manager not to add anything) then add the decorations myself. The following code pieces are from my application: #include #include #include OLWinAttr *wmWinAttr; Atom wmWinAttrAtom; Atom wmWtCmd; Atom wmWtOther; long wmMenuLimited; Atom wmDecorAdd; Atom wmDecorResize; Atom wmDecorHeader; Atom wmProtocols; ..../* toplevel has been created and display has been opened successfully */ wmProtocols = XInternAtom(display, "WM_PROTOCOLS", True); if (wmProtocols == None) { wmWinAttr = NULL; wmWinAttrAtom = None; wmWtOther = None; wmWtCmd = None; wmMenuLimited = 0; wmDecorAdd = None; wmDecorResize = None; wmDecorHeader = None; } else { wmWinAttrAtom = XInternAtom(display, "_OL_WIN_ATTR", True); wmWtOther = XInternAtom(display, "_OL_WT_OTHER", True); wmWtCmd = XInternAtom(display, "_OL_WT_CMD", True); wmWinAttr = (OLWinAttr *) malloc(sizeof(OLWinAttr)); wmWinAttr->win_type = wmWtOther; wmDecorAdd = XInternAtom(display, "_OL_DECOR_ADD", True); wmDecorResize = XInternAtom(display, "_OL_DECOR_RESIZE", True); wmDecorHeader = XInternAtom(display, "_OL_DECOR_HEADER", True); } ..... /* a dialog box "dbx" has been created ... */ Atom protocols[2]; if (!XmIsMotifWMRunning(toplevel)) { XChangeProperty(display, XtWindow(XtParent(dbx)), wmWinAttrAtom, XA_ATOM, 32, PropModeReplace, (unsigned char *)wmWinAttr, OLWinAttrNum32s); protocols[0] = wmDecorResize; protocols[1] = wmDecorHeader; XChangeProperty(display, XtWindow(XtParent(dbx->widget)), wmDecorAdd, XA_ATOM, 32, PropModeReplace, (unsigned char *) protocols, 2); } This works great for me except the titles are not quite right. The title is in the title area of the dialog box, but I have to resize the box (i.e., widen it) to see it. Hope this helps! Debbie ----------------------------------------------------------------------------- Debbie Catalano catalano@inference.com Inference Corporation 213-322-5004 x194 "I'm a member of the LA X User's Group, not the LAX User's Group!" -----------------------------------------------------------------------------