Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!hplabs!nsc!voder!dtg.nsc.com!shay From: shay@dtg.nsc.com (Shay Ben-Chorin) Newsgroups: comp.windows.x.motif Subject: Possible bug in Motif1.1 Keywords: Motif1.1, XmScrolledWindow, XmRowColumn Message-ID: <1581@ace.nsc.com> Date: 13 Dec 90 00:23:19 GMT Organization: National Semiconductor, Santa Clara Lines: 108 Hi, I am using Motif 1.1 on Sun4/110 and have problems with combination of scrolled window and row column widget. I create the following widget tree: toplevel | XmScrolledWindow | XmRowColumn | XmToggleButton When I destroy the toggle button (by calling the destroy_callback) in X11R4 (fix level 18 with twm or mwm) I get a bottom scrollbar with a tiny center bar although the window is empty. In Open Windows (rev 2 with twm) the program exits as soon as I destroy the toggle button with the following error message: [ace]2% bug X Error of failed request: BadAlloc (insufficient resources for operation) Major opcode of failed request: 12 (X_ConfigureWindow) Minor opcode of failed request: 128 Resource id in failed request: 0x0 Serial number of failed request: 86 Current serial number in output stream: 111 [ace]3% This is my test program bug.c (you can try to run it...) ======================== CUT HERE =============================== #include #include #include #include #include #include #include #include #include void create_windows(); void destroy_callback(); int main( argc, argv ) int argc; char *argv[]; { Widget toplevel; toplevel = XtInitialize( argv[0], "Bug", NULL, 0, &argc, argv ); create_windows( toplevel ); XtRealizeWidget( toplevel ); XtMainLoop(); } void create_windows( parent ) Widget parent; { Widget swindow, rowcol, toggle, Widget bboard; int n; Arg wargs[15]; n = 0; XtSetArg( wargs[n], XmNscrollingPolicy, XmAUTOMATIC ); n++; swindow = XmCreateScrolledWindow ( parent, "swindow", wargs, n ); XtManageChild ( swindow ); n = 0; XtSetArg( wargs[n], XmNorientation, XmHORIZONTAL ); n++; XtSetArg( wargs[n], XmNspacing, 5 ); n++; rowcol = XtCreateManagedWidget( "rowcol", xmRowColumnWidgetClass, swindow, wargs, n ); n = 0; toggle = XtCreateManagedWidget( "toggle", xmToggleButtonWidgetClass, rowcol, wargs, n ); XtAddCallback( toggle, XmNarmCallback, destroy_callback, toggle ); } void destroy_callback( w, client_data, call_data ) Widget w; Widget client_data; XmListCallbackStruct *call_data; { XtDestroyWidget( w ); } ======================== CUT HERE =============================== This is my make file: CC = cc CFLAGS = -D_NO_PROTO -g IDIR = -I/usr/include/X11 LIB = -lXm -lXt -lX11 bug: bug.o $(CC) -o bug bug.o $(IDIR) $(LIB) bug.o: bug.c $(CC) -c $(CFLAGS) bug.c $(IDIR) $(LIB) Is this a bug? How can I fix the problem? (except for creating a dummy widget inside rowcol that will always stay there). Thanks, Shay