Sizing a window

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

Questions about motif? Contact us

2 posts / 0 new
Last post
Sizing a window

Submitted by machnone on Fri, 02/09/2001 - 19:42. Developers
I am having a couple problems when it comes to sizing a window.
First, I set the XmNleftOffset and XmNrightOffset values of my main shell, but the window always comes up in the upper-left corner? Why is that?
Second, I resize the window based on the current resolution, but when I start typing in a text box, the window snaps back to its original size.

Any ideas?

ICS_support

If I recall correctly, XmNleftOffset and XmNrightOffset are actually the values that the XmForm looks for on its children to determine where to place them. The resources are constraint resources for those children; they are not resources on the shell. To locate the shell, you can set the XmNx and XmNy resources; with a cooperative window manager, the window will wind up where you want.

The snap-back behavior that you describe is symptomatic of a window set up, with a geometry that depends on unfixed contraints. That is, the window is perhaps an XmForm, but its geometry is set up such that it depends for its size on the size of another widget which changes in size. The solution is to fix the size of the widget (by setting the number of columns it shows) or to set the major window`s geometry so that it doesn`t float with the variable piece.