Centering Text in Win32
- Posted by Ad Rienks <Ad_Rienks at COMPUSERVE.COM> Nov 05, 1998
- 394 views
-- resize demo include Win32Lib.ew constant Main =3D create(Window, "Resize demo", 0, Default, Default, 640 , 480= , 0) global procedure onResize_Main(integer clientX, integer clientY) integer len, fontwidth sequence sizes, text fontwidth =3D 12 setFont(Main, "Courier New", fontwidth, Bold) sizes =3D getWindowSize(Main) len =3D sizes[3] - sizes[1] -- rigth - left text =3D "Window width =3D " & sprintf("%d", len) len =3D floor((sizes[3] - sizes[1] - fontwidth*length(text))/2) setPosition(Main, len, 10) wPuts(Main, text) end procedure onResize[Main] =3D routine_id("onResize_Main") WinMain(Main) = -------------------- original message: All, I need a little help with a procedure to Center Text on a line in a Window, I am using win32lib and the Window is Re-sizeable. TIA, Later, + + + Rev. Ferlin Scarborough - Centreville, Alabama - USA