[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1225.0. "How to add an event handler w/o an event mask?" by MDVAX3::ENDSLEY (MJ Endsley, SWS @ St. Louis) Wed Aug 02 1989 20:01

    Argh...

    Can someone shed some light on how I'd go about registering a
    GraphicsExpose event handler for a WINDOW widget?

    ADD EVENT HANDLER requires an event mask, and I can't find such a
    critter for GraphicsExpose events.

    In just plain 'ole X, you don't have to worry 'bout issuing a SELECT
    INPUT for graphics exposure, since you indicate your interest in the
    event by setting the appropriate field in the GC.

    Hints or suggestions?  I really don't want to write my own event
    dispatcher to account for this single event, but that's the only
    solution I can think of right now. 


    Mike Endsley
    SWS @ STO

T.RTitleUserPersonal
Name
DateLines
1225.1PSW::WINALSKIMeetings are our most important productWed Aug 02 1989 20:2127
You let the Toolkit do it for you.  When you create the window widget, specify
an expose callback.  Here is the UIL for a window widget with such a
routine:

    object
	status_center_data: window {
 	    arguments {
		adb_bottom_attachment= DwtAttachOppWidget;
		adb_bottom_widget= label status_center_label;
		adb_left_attachment= DwtAttachWidget;
		adb_left_widget= label status_center_label;
		border_width= 0;
		height= 15;
		width= 360;
	    };

	    callbacks {
		create = procedure create_coord_proc(k_coord_center);
		expose = procedure expose_coord(k_coord_center);
	    };
	};

The expose callback routine gets called for expose events, graphics expose
events, and noExpose events.

--PSW

1225.2HANNAH::MESSENGERBob MessengerWed Aug 02 1989 22:2016
Re: .0

>    ADD EVENT HANDLER requires an event mask, and I can't find such a
>    critter for GraphicsExpose events.

The third parameter to XtAddEventHandler is "other", which is "A Boolean
value that indicates whether this procedure should be called on nonmaskable
events, which include Graphics Expose, No Expose...".

In other words, instead of setting a bit in the event_mask parameter, to
get GraphicsExpose events you should set the other parameter to True.  Your
procedure should be prepared discard events you aren't interested, such
as SelectionClear, SelectionRequest, etc.

				-- Bob

1225.3Thanks -- I'll give it a whirlMDVAX3::ENDSLEYMJ Endsley, SWS @ St. LouisThu Aug 03 1989 10:1018
    RE: .1

    Hmm... Your description of the expose callback doesn't match what I've
    been seeing (e.g. I've been getting expected Expose events, but not
    GraphicsExpose nor NoExpose).  Let me check and ensure that consarned
    bit is set in the GC. 

    RE: .2

    Ah Hah!  That's what the magic meant.  I'll give it a whirl and see
    what happens. 

    Thanks much gents...


    Mike Endsley
    SWS @ STO