Is it possible to change the justification of a TextGadget dynamically? The only forum entries I found say no, but they are 10 yrs old.
Thank you Shardik, that works. I did shrink the code for Windows only:
Procedure Justify ( WhichGadget, Justification )
Define i
WhichGadget = GadgetID(WhichGadget)
i = GetWindowLongPtr_(WhichGadget, #GWL_STYLE)
Select Justification
Case -1 : i & ~#SS_CENTER & ~#SS_RIGHT | #SS_LEFT
Case 0 : i & ~#SS_LEFT & ~#SS_RIGHT | #SS_CENTER
Case 1 : i & ~#SS_LEFT & ~#SS_CENTER | #SS_RIGHT
EndSelect
SetWindowLongPtr_(WhichGadget, #GWL_STYLE, i )
InvalidateRect_(WhichGadget, 0, #True)
EndProcedure
[Solved] TextGadget text justification
[Solved] TextGadget text justification
Last edited by k3pto on Sun Jan 19, 2025 1:40 am, edited 1 time in total.
Re: TextGadget text justification
You didn't mention your operating system. Therefore you may try this cross-platform example which demonstrates how to toggle the text alignment in a TextGadget dynamically between left, centered and right.k3pto wrote: Thu Jan 16, 2025 10:23 pm Is it possible to change the justification of a TextGadget dynamically? The only forum entries I found say no, but they are 10 yrs old.