Submitted by Anonymous on Mon, 10/15/2001 - 21:19. Developers
Hi,
I have a problem with the position and size of widget when the position of a child widget
is for ex. -1, -1 or if the dimension is greater than the size of the parent widget.
The only solution that I found is unmanage the child widget (XtUnmanageChild) change
size and position and re manage the child widget (XtManageChild).
Obviously doing so there is a continuous focus-change.
Does anybody know another solution?
Thanks
Kappa
It really depends on the parent in question. Generally, parent widgets are managers which have some particular idea of how their children should be arranged so as to present a reasonable user interface to the end user. For the XmRowColumn, for example, the children are arranged in a line, and the sizes may be normalized. Normally, the XtNx and XtNy locations of the children are ignored, and the position of the children is set by the parent`s geometry and its layout policy.
A very few widgets will allow specific placement by position -- XmForm, XmDrawingArea, XmBulletinBoard. And fewer will allow negative placements -- XmDrawingArea and XmBulletinBoard, when XmNmarginWidgth is 0, and the XmScrolledWindow.
Thank you very much for your suggestion dbl but unfortunately I already used this information and I discovered some interesting information.
This is what I discovered
I have a XmDrawingArea (the parent) with the following set
XmNminWidth, 0
XmNminHeight, 0
XmNmarginWidth, 0
XmNmarginHeight, 0
XmNresizePolicy, XmRESIZE_NONE
XmNborderWidth, 0
XmNresizePolicy, XmRESIZE_NONE
I have a XmScrolledList (the child) with the following set
XmNx, 0
XmNy, 0
XmNwidth, 0
XmNheight, 0
XmNlistSizePolicy, XmCONSTANT
XmNselectionPolicy, XmSINGLE_SELECT
XmNborderWidth, 1
I try, afer a click event, to change the size and dimension of the child but if the algebric sum of new position and new dimension is bigger than the size of the parent, it doesn`t work.
So all the following changes are allowed (if the parent size is 100 x 100)
XtVaSetValues (XtParent(child), XmNx, 0, XmNy, 0, XmNwidth, 100, XmNheight, 100)
XtVaSetValues (XtParent(child), XmNx, -10, XmNy, -10, XmNwidth, 110, XmNheight, 110)
Whereas
XtVaSetValues (XtParent(child), XmNx, 10, XmNy, 10, XmNwidth, 100, XmNheight, 100)
Does nothing.
To change the size of the list I use the XtParent() widget of XmScrolledList that is the XmScrolledWindow widget of the scrolledlist
Have you any idea?