[comp.windows.x] A Motif bug?

don@zardoz.coral.COM (Don Dewar) (07/25/90)

I am having something very peculiar happen using scrolled lists within
forms.  I reproduced this same anamoly in both code and uil.  I am
trying to create the following "window-scenario"


      +--------------------------------+
      | DialogShell                    |
      | +----------------------------+ |
      | | Form                       | |
      | | +------------------------+ | |
      | | | Label                  | | |
      | | +------------------------+ | |
      | | +------------------------+ | |
      | | | ScrollWindow           | | |
      | | | +--------------------+ | | |
      | | | | List               | | | |
      | | | |                    | | | |
      | | | |                    | | | |
      | | | |                    | | | |
      | | | +--------------------+ | | |
      | | +------------------------+ | |
      | | +------------------------+ | |
      | | | RowColumn              | | |
      | | | +--------------------+ | | |
      | | | | Button             | | | |
      | | | +--------------------+ | | |
      | | +------------------------+ | |
      | +----------------------------+ |
      +--------------------------------+


I wrote the following uil file to do this.


module motifmain
version = 'v1.0'
names = case_sensitive
include file 'XmAppl.uil';
include file 'error.uil';


object
   ListWindow : XmFormDialog
   {
      arguments
      {
         XmNx = 600;
         XmNy = 200;
         XmNdialogStyle = XmDIALOG_MODELESS;
         XmNresizePolicy=XmRESIZE_ANY;
      };
      controls
      {
         managed XmLabel          FakeLabel;
         managed XmScrolledWindow ListBox;
         managed XmRowColumn      testListPushButtons;
      };
   };

object
   FakeLabel : XmLabel
   {
      arguments
      {
         XmNlabelString = "testing 1,2,3...";
         XmNtopAttachment = XmATTACH_FORM;
         XmNleftAttachment = XmATTACH_FORM;
      };
   };


object
   ListBox : XmScrolledWindow {
      arguments {
          XmNtopWidget = XmLabel FakeLabel;
          XmNbottomWidget = XmRowColumn testListPushButtons;
          XmNleftAttachment = XmATTACH_FORM;
          XmNrightAttachment = XmATTACH_FORM;
          XmNtopAttachment = XmATTACH_WIDGET;
          XmNbottomAttachment = XmATTACH_WIDGET;

      };
      controls
      {
         XmList ListWidget;
      };
   
   };

object ListWidget : XmList
   {
      arguments {
          XmNunitType = XmPIXELS;
          XmNvisibleItemCount = 4;
          XmNselectionPolicy = XmMULTIPLE_SELECT;
          XmNitems = string_table("one", "two", "three", "four", "five", "six", "seven");
          XmNitemCount = 7;
      };
   };

  

object
   testListPushButtons : XmRowColumn
   {
      controls
      {
         managed XmPushButton ListCancelButton;
      };


      arguments
      {
         XmNleftAttachment = XmATTACH_FORM;
         XmNbottomAttachment = XmATTACH_FORM;
         XmNrightAttachment = XmATTACH_FORM;
      };
   };

object
   ListCancelButton : XmPushButton
   {
      arguments
      {
         XmNlabelString = "Cancel";
      };
   };

end module;


I also wrote code that did essentially the same thing.  When I try to
manage child after fetching the widget, however, the program appears
to stop in the middle of creating the lable gadget for the scroll bars,
but continues processing events.  If I stop the program in GDB this is
the traceback I get:


#0  0x65894 in XmCreateLabelGadget ()
#1  0x12527c in XtQueryGeometry ()
#2  0xcae3c in InitializeScrollBars ()
#3  0xcd458 in InitializeScrollBars ()
#4  0x124dec in XtConfigureWidget ()
#5  0x530b0 in _XmConfigureObject ()
#6  0x4bcb0 in XmCreateFileSelectionDialog ()
#7  0x4c0c0 in XmCreateFileSelectionDialog ()
#8  0x1265dc in _XtClassIsSubclass ()
#9  0x126d3c in XtRealizeWidget ()
#10 0x4240c in XmCommandError ()
#11 0x128c5c in XtManageChildren ()
#12 0x128f18 in XtManageChild ()
#14 0x85cc in PmListWindowCreateCb (wbutton=(Widget) 0x2570d0, pname=(char *) 0x257028 "test", cbstruct=(XmAnyCallbackStruct *) 0xf7fff120) (pmwindow.C line 227)
#15 0x118388 in _XtCallCallbacks ()
#16 0x118b24 in XtWidgetCallCallbacks ()
#17 0x86188 in XmResolvePartOffsets ()
#18 0x147a84 in _XtMatchUsingStandardMods ()
#19 0x12135c in XtWindowToWidget ()
#20 0x121c24 in DispatchToSpringLoaded ()
#21 0x121ca0 in XtDispatchEvent ()
#22 0x1223c4 in XtAppMainLoop ()
#23 0x1223a4 in XtMainLoop ()
#24 0x2900 in main (...) (...)


My program brings up this window as a child of the main
window and if I try to close this child window, the main window is
also closed (or at least it disappears), but the program continues
execution.  


Another problem I ran into while reproducing this in uil was that
attachments from XmScrollList widgets don't work correctly.  Instead
of attaching the scrolling window to the outside, it attaches the list
widget.  This, of course, has no affect at all.  This is why my sample
uil file above has a scrolling window and a list widget instead of a a
ScrollList.

If anyone knows if this is a bug, or has a way to work around this
problem, or can help me in any way, I would be most grateful.


  +---------+
  | Coral   |
  |@@@@@*@**|
  |@@*@@**@@|     Don Dewar
  |*@@**@@@@|     Coral Network Corporation, Marlborough, MA
  |@***@@@@@|     Internet: don@coral.com
  |@@**@@@@@|     Phone:    (508) 460-6010
  |*********|     Fax:      (508) 481-6258
  |Networks |
  +---------+