andrew@resam.dk (Leif Andrew Rump) (01/24/91)
This is a question for the real programmer so please dig in!!! My problem is as follows: I have a program with two buttons: Enter & Reset (Alfaskop keys!). When I press the Enter button I send something to a mainframe and expect and answer back - but it may take minutes! That's why the Reset button was implemented - but to get the notifier to dispatch the Reset callback routine the Send callback routine has to return to the notifier - i.e. it is not busy anymore! NOTE 1: We use notify_set_input_func & notify_set_itimer_func to implement a time out functionality and it seems to work. My question is as follows: May I use a notify_dispatch loop in the Enter callback function to dispatch the Reset callback function if the user presses the button? How should I write it (when considering NOTE 1)? I create a CPU consuming loop if I write (Explicit dispatching): XFlush(dpy); while (!reset_pressed) { notify_dispatch(); XFlush(dpy); /* I have _no_ code to put here - stolen from p.400 */ } NOTE 2: I'm not able to use implicit dispatching because I'm not using the standard read() even though I have a file desc. for notify_set_input_func and it wouldn't help me because **************************************************************** *** The only thing I want is: To keep the Enter button busy! *** **************************************************************** NOTE 3: I will not use a notice box as long as they grab the whole screen. Because there is other applications running. Leif Andrew Leif Andrew Rump, AmbraSoft A/S, Stroedamvej 50, DK-2100 Copenhagen OE, Denmark UUCP: andrew@ambra.dk, phone: +45 39 27 11 77 / Currently at Scandinavian Airline Systems =======/ UUCP: andrew@resam.dk, phone: +45 32 32 51 54 \ SAS, RESAM Project Office, CPHML-V, P.O.BOX 150, DK-2770 Kastrup, Denmark > > Read oe as: o <backspace> / (slash) and OE as O <backspace> / (slash) < <
andrew@resam.dk (Leif Andrew Rump) (01/24/91)
This is a question for the real programmer so please dig in!!! My problem is as follows: I have a program with two buttons: Enter & Reset (Alfaskop keys!). When I press the Enter button I send something to a mainframe and expect and answer back - but it may take minutes! That's why the Reset button was implemented - but to get the notifier to dispatch the Reset callback routine the Send callback routine has to return to the notifier - i.e. it is not busy anymore! NOTE 1: We use notify_set_input_func & notify_set_itimer_func to implement a time out functionality and it seems to work. My question is as follows: May I use a notify_dispatch loop in the Enter callback function to dispatch the Reset callback function if the user presses the button? How should I write it (when considering NOTE 1)? I create a CPU consuming loop if I write (Explicit dispatching): XFlush(dpy); while (!reset_pressed) { notify_dispatch(); XFlush(dpy); /* I have _no_ code to put here - stolen from p.400 */ } Is there a way to block the callback routine if there is nothing to dispatch?!? NOTE 2: I'm not able to use implicit dispatching because I'm not using the standard read() even though I have a file desc. for notify_set_input_func and it wouldn't help me because **************************************************************** *** The only thing I want is: To keep the Enter button busy! *** **************************************************************** NOTE 3: I will not use a notice box as long as they grab the whole screen. Because there is other applications running. Leif Andrew Leif Andrew Rump, AmbraSoft A/S, Stroedamvej 50, DK-2100 Copenhagen OE, Denmark UUCP: andrew@ambra.dk, phone: +45 39 27 11 77 / Currently at Scandinavian Airline Systems =======/ UUCP: andrew@resam.dk, phone: +45 32 32 51 54 \ SAS, RESAM Project Office, CPHML-V, P.O.BOX 150, DK-2770 Kastrup, Denmark > > Read oe as: o <backspace> / (slash) and OE as O <backspace> / (slash) < <