[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

3163.0. "Events .vs. signals?" by SNOC02::ZAMBOTTIW (It only works after you ask!) Thu Aug 02 1990 05:36

    Hi there,
    
    I would like some why of determining whether the user has resized a
    window so that I can take appropriate action.
    
    I am only using the X lib (no UIL) and an event would seem appropriate
    except for one point.  I haven't seen a way of having an event send a
    signal to my process so I can avoid polling the event queue.
    
    Due to the nature of the software it is almost impossible to poll the
    event queue because of the extremely poor structure of the program.  I
    would have to put event queue processing code in several hundred places
    throughout the code (unfortunately not my code and I can't re-write
    it).
    
    The only event I am interested in is window resizing at the moment.
    
    I have come up with a yucky solution which looks like :
    
    	#define ResizeEventCheckTimeOut 2
    	.
    	.
    	.
    
    	signal(SIGALRM, CheckResizeEvent) ;
    	alarm(ResizeEventCheckTimeOut) ;
    
    	.
    	.
    	.
    
    	CheckResizeEvent()
    
    	{
    		/* event processing */
    
    		signal(SIGALRM, CheckResizeEvent) ;
    		alarm(ResizeEventCheckTimeOut) ;
    	}
    
    This allows you to place the signal/alarm combination once at the
    beginning of the application and have the CheckResizeEvent function
    periodically called to check for events.
    
    Two problems.  One, still have to poll but at least poll overhead has
    been reduced so.  Two, only works with low priority events.  You
    definately couldn't use this with motion notify events.
    
    What I am hopping will do the trick for me is the X lib function :
    
    	XSelectAsyncEvent(display, w, event_mask, procedure, argument)
    
    Can anyone tell me if this will help me and could a small laymen
    explanation come along with any other advise about this function.  And
    what event mask should I be using in order to receive a window resize
    
    
    Regards,
    
    Walter Zambotti.
T.RTitleUserPersonal
Name
DateLines
3163.1DECWIN::FISHERLocutus: Fact or Fraud?Thu Aug 02 1990 11:1811
You may find more info in the previous note you wrote as well.  I think you
probably want ConfigureNotify rather than ResizeRequest.

As to the async stuff, that should do what you want in either Ultrix or VMS.
However, it is DEC-specific.  The most important thing to know about async is
that the fact that the AST/Signal has sprung indicates that there is a request
of the specified nature in the queue.  It does not *do* anything with the
request.  You must read the request with XNextEvent or whatever, presumably
within the AST/Signal routine.

Burns