Article View: comp.windows.x
Article #23872NOTIFY Dispatch WOES!
From: Mark Scoville
Date: Wed, 19 Jun 1991 15:49
Date: Wed, 19 Jun 1991 15:49
91 lines
2633 bytes
2633 bytes
I am attempting EXPLICIT DISPATCHING, and am failing sorely! After invoking
the application, I toggle back and forth about 3 times or so between 'Start
Loop' and 'STOP'. At some point it hangs on STOP.
=================================
SPARCstation 1/2
SunOS 4.0.3/4.1
XView 2.0
DevGuide 1.1
OW 2.0
=================================
Thanks in advance.
**********************************************
* Mark Scoville (415) 683-4332 *
* mms@nmri.ge.com -OR- ...!sane!genmri!mms *
**********************************************
---------------------------- code fragment -------------------------
int flag = FALSE,
looper = 0;
Display *dpy;
void
main(argc, argv)
int argc;
char **argv;
{
ntf_window1_objects *ntf_window1;
/* Initialize XView. */
xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0);
INSTANCE = xv_unique_key();
/* Initialize user interface components. */
ntf_window1 = ntf_window1_objects_initialize(NULL, NULL);
dpy = (Display *)xv_get(ntf_window1->window1, XV_DISPLAY);
xv_set(ntf_window1->window1, XV_SHOW, TRUE, NULL);
XFlush(dpy);
/* Turn control over to XView. */
while(looper < 1000)
{
notify_dispatch();
XFlush(dpy);
LoopFct(ntf_window1);
}
exit(0);
}
/* Notify callback function for `button1'. */
void
FctDoLoop(item, event)
Panel_item item;
Event *event;
{
ntf_window1_objects *ip = (ntf_window1_objects *) xv_get(item,
XV_KEY_DATA, INSTANCE);
switch (flag)
{
case FALSE: xv_set(ip->button1,
PANEL_LABEL_STRING, "STOP", NULL);
flag = TRUE;
notify_stop();
break;
case TRUE: xv_set(ip->button1,
PANEL_LABEL_STRING, "Start Loop", NULL);
flag = FALSE;
break;
}
}
LoopFct(ip)
ntf_window1_objects *ip;
{
char val[20];
while (flag)
{
notify_dispatch();
XFlush(dpy);
sprintf(val, "%d", looper++);
xv_set(ip->textfield1, PANEL_VALUE, val, NULL);
}
return(0);
}
------------------------------ end code fragment -----------------------------
Technical Details
Message-ID:
<9106191549.AA25895@genmri.sane.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!bloom-beacon!dont-send-mail-to-path-linesShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: mms@genmri.UUCP (Mark Scoville) Newsgroups: comp.windows.x Subject: NOTIFY Dispatch WOES! Message-ID: <9106191549.AA25895@genmri.sane.COM> Date: 19 Jun 91 15:49:39 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 91