Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Feb 1995 16:57:31 -0500
From:      "Milo A. Chan" <chan_milo@jpmorgan.com>
To:        pbeiler@fnma.COM
Cc:        oi-users@freefall.cdrom.com
Subject:   RE: Losing Focus Callback
Message-ID:  <199502272157.QAA03064@newton.ny.jpmorgan.com>
References:  <9502271928.AA21016@sydney.fnma.com>

next in thread | previous in thread | raw e-mail | index | archive | help
You can push a fake FocusOut event for the previous object having focus back
onto the X event queue.

If you are using translations to define the user-callbacks, you could redefine
the fire() action procedure for OI_menu_cell to do this.

But a better way (according to Tom LaStrange), would be to send the fake
FocusOut event from a pre-popup callback bound to the pulldown menus in the
main menu.

Here is a code frag which may help you get started:

	if (conp->has_focus() && is_main_menu() && connection()->last_focus()) {
		XEvent event;

		event.xfocus.type = FocusOut;
		event.xfocus.send_event = False;
		event.xfocus.display = connection()->display();
		event.xfocus.window = connection()->last_focus()->x_window_id();
		event.xfocus.mode = NotifyNormal;
		event.xfocus.detail = NotifyDetailNone;
		XPutBackEvent(connection()->display(), &event);
	}

good luck,
-Milo

> From: Phillip Beiler on Mon, February 27, 1995 14:28
> Subject: Losing Focus Callback
> Sent-To: uunet!freefall.cdrom.com!oi-users@uunet.uu.net, oi-support@boulder.openware.com
> 
> 
> This is my last resort, oi-support seems to be on vacation!!!!
> Thanks for any help...
> 
> 
> I have a simple losing focus callback problem....
> 
> I have a bunch of fields in a box, and the box is parented to an
> app window, which, has a motif style mainmenu ... simple...
> 
> I get all the losing focus events when I tab between fields, mouse
> out of the window, etc,.....
> 
> However, when I click on the mainmenu bar and select an option (one motion,
> without releasing the mouse), the menucell callback fires. After the menucell
> callback returns, the losing focus callback fires....
> 
> Unfortunately for me, this is exactly the opposite of what I NEED...
> 
> Without alot of explanation, the losing focus callbacks are in a library, and
> the mainmenu bar (memucell) callbacks are the users.
> 
> Do you have any suggestions on changing the callback firing order?
> 
> Phil
> -----------------------------------------------------------------------------
> Phil Beiler                             Federal National Mortgage Association
> pbeiler@fnma.com                                        Advanced Technologies 
> (202) 752-3667                                         Washington, D.C. 20016  
> -----------------------------------------------------------------------------

--
Milo Chan, V.P.                              J.P. Morgan Securities, Inc.
email:   chan@jpmorgan.com      ...or...      chan@fractl.tn.cornell.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199502272157.QAA03064>