[comp.windows.x.motif] Bulletin Board Bug

larry@sunrise.com (Larry Rogers) (12/20/90)

I have recently found a strange behavior of bulletin boards
when they are childed to a main window.  When you attempt
to specify the size of the bulletin board, it works OK. But
as soon as you manage its main window parent, the Bulletin
board is resized to some small size (always 20,20).  

If no main window is used, the Bulletin Board appears the 
correct size.  If you manage the main window and then size
the bulletin board with XtSetValues, it works fine.  If you
use a Form instead of a Bulletin Board, it works fine. What's
the scoop, anybody know if this is a bug?

Please respond by mail.

Example C Code:

#include <stdio.h>
#include <errno.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <sys/time.h>
#include <values.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/StringDefs.h>
#include <X11/IntrinsicP.h>
#include <X11/Intrinsic.h>
#include <X11/Xatom.h>
#include <X11/Shell.h>
#include <Xm/Xm.h>
#include <Xm/MainW.h>
#include <Xm/BulletinB.h>
#include <Xm/DialogS.h>

main(argc, argv)
int argc;
char **argv;
{
   Widget topLevelShell, shellWidget, BBWidget, mainWindow;
   XtAppContext app;
   Arg args[2];

   topLevelShell = XtAppInitialize(&app, "Bad", NULL, 0, &argc, argv,
                                   NULL, NULL, 0);

   shellWidget = 
      XmCreateDialogShell(topLevelShell, "dialog", NULL, 0);
   
   mainWindow = XmCreateMainWindow(shellWidget, "Main", NULL, 0);

   XtSetArg(args[0], XmNwidth, 800);
   XtSetArg(args[1], XmNheight, 800);
   /* If this is a form it works */
   BBWidget = XmCreateBulletinBoard(mainWindow, "board", args, 2);

   XtSetArg(args[0], XmNworkWindow, BBWidget);
   XtSetValues(mainWindow, args, 1);

   XtManageChild(BBWidget);
   XtManageChild(mainWindow); 
   
   XtAppMainLoop(app);
}

Bad Resource File:

*dialog.title: Bad Bulletin Board
*dialog.unitType: PIXELS
*dialog.allowShellResize: True
*board.width: 500
*board.height: 500
*board.background: green
*board.resizePolicy: RESIZE_GROW
-- 
Larry Rogers
larry@sunrise.com
...!uunet!ezx!larry