Word wrap in user window

Post Reply
Apocalyptic
Posts: 7
Joined: Sun Apr 26, 2009 1:42 pm

Word wrap in user window

Post 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?

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Word wrap in user window

Post by Heiko »

setWindowWrap( windowName, wrapAt )

Import the compass demo package and see how it works.

Jaren
Posts: 31
Joined: Sun Nov 17, 2013 1:55 pm

Re: Word wrap in user window

Post 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

User avatar
demonnic
Posts: 682
Joined: Sat Dec 05, 2009 3:19 pm

Re: Word wrap in user window

Post by demonnic »

I'm pretty sure if you use Geyser UserWindows then you can set the autoWrap property to true and achieve this.

Post Reply