Page 1 of 1

Word wrap in user window

Posted: Tue May 19, 2009 7:18 am
by Apocalyptic
Okay! So I got all of my chat user windows working and docked and all that. The problem is...none of them have word wrap or whatever. I need to wrap the words to each individual window. How do I do that? Vadi told me how to do it, but that does not work, or I am not doing it right. Can I get some help with this please? Also, there is a block cursor in each of the windows. While they do display the text, I wish there was a way to get rid of that silly empty block cursor thingy. So how do I wrap the text in each of these non-main windows?

Re: Word wrap in user window

Posted: Tue May 19, 2009 8:00 am
by Heiko
setWindowWrap( windowName, wrapAt )

Import the compass demo package and see how it works.

Re: Word wrap in user window

Posted: Sun Oct 11, 2020 3:50 am
by Jaren
Sort of an old post but I have been struggling with this very question.

Is there any way to dynamically change the word wrap of a user window to change depending on the current width of the window?

I threw together some code which works fairly well but it doesn't scale perfectly given that each font size has a different actual pixel width.

Code: Select all

function UserWindowWrap()
  uwFontSize = getFontSize("MyUserWindow")
  uwWidth, uwHeight = getUserWindowSize("MyUserWindow")
  uwPixelSize = uwFontSize + 5.5
  uwPixelWrap = uwWidth / uwPixelSize
  setWindowWrap("MyUserWindow", uwPixelWrap)
end

--Add UserWindowWrap() before all echoes to MyUserWindow

Re: Word wrap in user window

Posted: Sun Oct 11, 2020 5:06 am
by demonnic
I'm pretty sure if you use Geyser UserWindows then you can set the autoWrap property to true and achieve this.