Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!ALEX.CSS.GOV!lynnes From: lynnes@ALEX.CSS.GOV (Christopher Lynnes) Newsgroups: comp.windows.x.motif Subject: Re: How does a client... Message-ID: <9103201310.AA01856@alex.CSS.GOV> Date: 20 Mar 91 13:10:15 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 38 >Does anyone know how a motif client can determine if it has >been iconified? Attempts to get window hints have returned >nothing useful. Source example would be nice too... Earlier I suggested getting the XmNiconic resource of the toplevel shell, but this does not seem to work. On the other hand, at least under mwm (Motif 1.1, Sun-3), the toplevel shell is unmanaged when iconified. The following timer callback checks iconification using both methods every 5 seconds. The toplevel shell is obtained via MrmFetchWidget. The first method always prints out that the top widget is not iconified. The second method correctly identifies whether it is iconified. HOWEVER. I have a sneaking suspicion that this may be dependent on the window manager, so use with caution. ------------------------------------------------------------------------ #include void CheckIconify(client_data, id) caddr_t client_data; XtIntervalId *id; { Widget top= (Widget)client_data; Arg arg[1]; Boolean is_iconic = 1; /* Method 1: doesn't work under mwm */ XtSetArg(arg[0], XmNiconic, &is_iconic); XtGetValues(top, arg, 1); printf("I am%s an icon?\n", is_iconic ? "" : " NOT"); /* Method 2: works under mwm */ printf("I am%s an icon!\n\n", XtIsManaged(top) ? " NOT" : ""); XtAddTimeOut(5000, CheckIconify, client_data); } ------------------------------------------------------------------------ Chris Lynnes ===== : = ::::: Teledyne Geotech ===== :: == ::::: Alexandria, Virginia ::: === (703) 739-7316 :: == lynnes@seismo.CSS.GOV : =