This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
1.5.25: Problem with XtAppAddWorkProc and OptionMenu
- From: "Wakker, P.H. (Pieter)" <wakker at nrg dot eu>
- To: <cygwin-xfree at cygwin dot com>
- Date: Fri, 10 Jul 2009 10:19:56 +0200
- Subject: 1.5.25: Problem with XtAppAddWorkProc and OptionMenu
- Reply-to: cygwin-xfree at cygwin dot com
- Xecn-outgoing-message:
Hi,
I am running CYGWIN 1.5.25 on Windows XP pack 2. I have a XWindows
graphics program that uses several XmOptionMenu widgets. The problem is
that whenever the user clicks frequently (sometimes a double-click is
enough) on these OptionMenu's the program crashes with a segmentation
error. This behaviour is not noticeable with the same program on HP-UX.
I reproduced the problem in the test program below. It seems as if the
combination of the WorkProc and the OptionMenu causes the problem. If I
remove the XtAppAddWorkProc statement there is no problem, but the only
widget that causes the crash is an OptionMenu (for example with a
PushButton I can't reproduce the crash).
Another thing I noticed is that when I reduce the number of microseconds
in the usleep command, I have to click faster to make the program crash.
It seems as if there is a relationship with how long the program is busy
in the WorkProc. In the actual program the usleep is replaced by
something useful of course.
Any help is appreciated.
Thanks,
Pieter
#include <Xm/Xm.h>
#include <Xm/Form.h>
#include <Xm/PushB.h>
Boolean ViewerCheck()
{
usleep(100000);
return False;
}
int main()
{
Widget TopLevel,form,wdg1,wdg2,wdg3,wdg4;
XtAppContext app;
int argc=0;
char *argv[1];
XtSetLanguageProc(NULL,NULL,NULL);
TopLevel = XtVaAppInitialize(&app,"Test",NULL,0,&argc,argv,NULL,NULL);
form = XtVaCreateManagedWidget( "Test",
xmFormWidgetClass, TopLevel,
XmNwidth, 100,
XmNheight, 60);
wdg1 = XmCreatePulldownMenu(form, "pulldown", NULL, 0);
wdg2 = XtVaCreateManagedWidget("1", xmPushButtonWidgetClass, wdg1,
XmNwidth, 60);
wdg3 = XtVaCreateManagedWidget("2", xmPushButtonWidgetClass, wdg1,
XmNwidth, 60);
wdg4 = XmCreateOptionMenu(form, "TEST", NULL, 0);
XtVaSetValues(wdg4, XmNsubMenuId, wdg1);
XtManageChild(wdg4);
XtRealizeWidget(TopLevel);
XtAppAddWorkProc(app, (XtWorkProc) ViewerCheck, (XtPointer) NULL);
XtAppMainLoop(app);
return 0;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/