🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: mitre.windows.x.xpert
1 messages
1 total messages Started by Cookson Tue, 29 May 1990 19:36
Event Loops
#2
Author: Cookson
Date: Tue, 29 May 1990 19:36
53 lines
2127 bytes
First off let me say thank you to all the people who replied to my first 
message.  Now for a slight clarification of my problem.
I'm avoiding an event loop by doing the following.


#include	"toolkit.h"
Display *mydisplay;
int	childpid;
int	fd;
end();

Event_Loop()
{

	while(XEventsQueued(mydisplay, QueuedAfterReading)) {
		XEvent	myevent;

		XtNextEvent(&myevent);
		XtDispatchEvent(myevent);
	}
}

Initialize_Toolkit(int argc, char *argv[])
{

  Widget control_shell, control_board, tracker_select, tracker_form;
  Widget start_button, quit_button;
  Arg wargs[2];
  
  /* Initialize the toolkit, and create the shell for the control window. */
  control_shell = XtInitialize(argv[0], "Xradar", NULL, 0, &argc, argv);
  mydisplay = XtDisplay(control_shell);
  fd = ConnectionNumber(mydisplay);
  fcntl(fd, F_SETOWN, getpid());
  fcntl(fd, F_SETFL, FASYNC);
  signal(SIGIO, Event_Loop);
  /*	Create all my widgets, etc... */
}

The problem is that when Event_Loop gets called, XEventsQueued() claims
that there are no events in the queue.  (Yes XtPending() says the same thing).
Now, it's obvious that I'm either blind or stupid (or both), and that I'm
missing something painfully obvious.  But the question is what????

Thanks in Advance,
Dean


% Dean Cookson				  $ Anyone can be taught to sculpt    %
% dcookson@mitre.org			    $ Michaelangleo would have had to %
% {devax,et al..}!linus!mbunix!helios!cookson $ have been taught how not to.  %
% Disclaimer: My opinions are my own, and       $ The same is true of great   %
%       are of questionable sanity                $ programmers               %
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads