Submitted by machnone on Sat, 12/09/2000 - 00:21. Developers
Is there a way to vertically center text in a TextField widget?
Fri, 06/29/2012 - 14:23
#1
vertically centered text
Questions about motif? Contact us
It`s not quite clear what you mean. Do you want horizontally-oriented text displayed in an XmTextField which is taller than one line, such that the extra space is spread out both above and below the line of text; or do you want vertically-oriented text displayed in a text widget which displays it in that direction? If the former, then you should have other parts of your application take up the extra space; if the latter, you can use the extension to Motif 2.0 which The Open Group put out (I believe with the abbreviation CTL, for something like Compound Text Layout).
I have horizontally oriented text that is smaller (shorter) than the current text box. I want it vertically centered, much like the VALIGN option in the
I think that the geometry of your application could be adjusted so that the text box is not so large.
The "password-entry" problem is handled by using an XmNmodifyVerifyCallback on the text field, caching the real input, and pushing back asterisks. There`s sample code in O`Reilly`s Volume 6A (there`s a new copy out) and probably also in the comp.windows.x.motif FAQ.