Widget positioning and resizing problem

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Widget positioning and resizing problem

Hi all,

I have a problem with the positioning and resizing of a child widget. The parent widget is an XmDrawingArea.
If I try to change the position and size of the child, it works only if the algebric sum of new position and new size is less than the size of the parent.
In other word, if the right-bottom corner of the child falls inside the canvas of the parent.

So the following changes are allowed (the parent size is 100 x 100)
XtVaSetValues (childWidget, XmNx, 0, XmNy, 0, XmNwidth, 100, XmNheight, 100),
XtVaSetValues (childWidget, XmNx, -10, XmNy, -10, XmNwidth, 110, XmNheight, 110),
whereas
XtVaSetValues ((childWidget, XmNx, 10, XmNy, 10, XmNwidth, 100, XmNheight, 100) does not work.

The only solution I found is to unmanage the child widget (XtUnmanageChild), change position and size and manage the child widget (XtManageChild) again.
Obviously this result in a continuous focus-change.

Does anybody know another solution?

Thanks

ICS_support

Uh, that`s how it`s supposed to work.

Normally, a parent widget is considered a manager widget. It has the responsibility of arranging its children. And, normally, the parent arranges the child so that the child is visible within the bounds of the parent -- normally, by requesting itself to grow when the child is resized.

There are a few exceptions

- the scrolled window, whose purpose is to display larger children

- the bulletin board and drawing area, who can display children out of their bounds -- provided that the margin widths are first set to 0. Make this change to the XmDrawingArea instance and see what happens.