Re: [Iup-users] Checking a dialog focus state
Brought to you by:
scuri
From: Margo S. <mar...@gm...> - 2010-10-27 03:43:17
|
Scuri, In a deserted island crash / nuclear war / aliens / etc scenario I would really really like to be around someone like you. Thank you! On Wed, Oct 27, 2010 at 6:02 AM, Antonio Scuri <sc...@te...>wrote: > The hint is on what you just said “some time”. My suggestion, use a > IupTimer with a callback that checks if the control with focus belongs to > the dialog. For example: > > > > Ihandle* timer = IupTimer(); > > IupSetAttribute(timer, “_MY_DIALOG”, (char*)dialog); > > …. > > > > > > int timer_cb(Ihandle* timer) > > { > > Ihandle* dialog = (Ihandle*)IupGetAttribute(timer, “_MY_DIALOG”); > > If (IupGetDialog(IupGetFocus()) != dialog) > > IupHide(dialog); > > // You can also stop or destroy the timer here > > return IUP_DEFAULT; > > } > > > > Best, > > Scuri > > > > *From:* Margo Skeiz [mailto:mar...@gm...] > *Sent:* quarta-feira, 27 de outubro de 2010 00:37 > *To:* IUP discussion list. > *Subject:* Re: [Iup-users] Checking a dialog focus state > > > > I want to hide the dialog after some time when it loses the focus. > I assumed I could do it in its focus callback, but this idea was wrong -- > it loses it to the child as soon as is shown, so there is of course no more > kill callbacks for the dialog itself to catch. > > I could hack in own WM_ACTIVATE callback to iupwin_dialog.c : > winDialogBaseProc, but don't know the corresponding procedures for other > platforms. Maybe there is an existing way to check if it's focused / > zordered / foregrounded? > > > > On Wed, Oct 27, 2010 at 4:21 AM, Antonio Scuri <sc...@te...> > wrote: > > Hi, > > > > You can combine/compare IupGetFocus and IupGetDialog. But depends when > you want to know that. Why you need that? > > > > Best, > > scuri > > > > *From:* Margo Skeiz [mailto:mar...@gm...] > *Sent:* terça-feira, 26 de outubro de 2010 21:39 > *To:* iup...@li... > *Subject:* [Iup-users] Checking a dialog focus state > > > > Hi Scuri and everyone, > > I'm trying to find a way to check if the top level window has focus, but it > seems impossible. > Since a parent receives KILLFOCUS_CB when its child gets focus, the dialog > receives this callback right away on Show. > > I've tried handle checking, returning IUP_IGNORE, watching child controls, > and praying Cthulhu without any visible success. > > Is there a workaround? > > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America > contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Iup-users mailing list > Iup...@li... > https://lists.sourceforge.net/lists/listinfo/iup-users > > > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America > contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Iup-users mailing list > Iup...@li... > https://lists.sourceforge.net/lists/listinfo/iup-users > > |