comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Window active event?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Window active event? [message #31761 is a reply to message #31758] Wed, 14 August 2002 11:11 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brandon Jones (bjones8@yahoo.com) writes:

> I have a program where I have multiple widget bases each with a draw
> widget inside of it. I want an event to be sent when the individual
> base (window) is made active, or brought to the front.
>
> I know there is the /Viewport_events keyword, but this only sends an
> event when the mouse enters the viewport. I want an event to be sent
> when the window is made active, such as through an Alt-Tab procedure.

Set the KBRD_FOCUS_EVENT keyword for each base widget.
When you get a keyboard focus event in your base widget
event handler, send any event you like to the draw widget.
It will look something like this:

PRO PROGRAM_TLB_EVENTS, event
thisEvent = Tag_Names(event, /Structure_Name)
IF thisEvent EQ 'KBRD_FOCUS_EVENT' THEN BEGIN
Widget_Control, event.top, Get_UValue=info, /No_Copy
; Create some kind of event. Whatever is appropriate.
; For example:
theEvent = {ID:info.drawID, TOP:event.top, HANDLER:0L, TYPE:0}
Widget_Control, info.drawID, Send_Event=theEvent
Widget_Control, event.top, Set_UValue=info, /No_Copy
ENDIF
...
END

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: UNCOMPRESS files on PCs
Next Topic: Accessing 2D array from pointer array within structure

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 10:19:03 PDT 2025

Total time taken to generate the page: 1.68392 seconds