shay@dtg.nsc.com (Shay Ben-Chorin) (12/13/90)
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 <stdio.h> #include <X11/StringDefs.h> #include <X11/Intrinsic.h> #include <X11/Shell.h> #include <Xm/Xm.h> #include <Xm/ScrolledW.h> #include <Xm/BulletinB.h> #include <Xm/RowColumn.h> #include <Xm/ToggleB.h> 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
dbrooks@osf.org (David Brooks) (12/14/90)
In article <1581@ace.nsc.com>, shay@dtg.nsc.com (Shay Ben-Chorin) writes: |> |> |> 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. I just tried this on our latest in-house build (almost the 1.1.1 patch release) and the thumb no longer appears. So this has been fixed; I'm not sure which bug report it would have been filed under. |> 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) This looks like an error generated by the OW server. You may be hitting a real limit. Sometimes problems like this mysteriously disappear if you rebuild OW. -- David Brooks dbrooks@osf.org Systems Engineering, OSF uunet!osf.org!dbrooks "No, I didn't say I wanted a Bud light!!!" -- Oedipus