Page 1 of 1

problem with scrollbar on static text

Posted: Mon Dec 18, 2006 14:34
by Sjizo
Hey all,

while reading through the forums I came acros this
post. In it there was a post of CE that you can add a vertical scrollbar to a static text widget by calling the function setVerticalScrollbarEnabled(true). So I tried this in my Lua script

Code: Select all

winMgr:getWindow("Root/ConsoleWindow"):setVerticalScrollbarEnabled(true)

where Root/ConsoleWindow is a static text widget
and I get the following error in the CEGUI.log

Code: Select all

18/12/2006 15:16:38 (Error)   Exception: Unable to execute Lua script file: '../datafiles/lua_scripts/consoleGui.lua'

[string "../datafiles/lua_scripts/consoleGui.lua"]:62: attempt to call method 'setVerticalScrollbarEnabled' (a nil value)


Have the scrollbars been taken away from the static text again? Or am I doing something wrong. I am using CEGUI 0.5

Posted: Wed Dec 20, 2006 09:36
by Sjizo
after speaking to Dalfy on irc I tried a diferent approach. I tried to use the setProperty function.

Code: Select all

winMgr:getWindow("Root/ConsoleWindow"):setProperty("VerticalScrollbar","true")


In the log I get the following error message

Code: Select all

19/12/2006 17:26:04 (Error)   Exception: There is no Property named 'VerticalScrollbar' available in the set.
19/12/2006 17:26:04 (Error)   Exception: System::executeScriptFile - An exception was thrown during the execution of the script file.


I also tried verticalScrollbar instead of VerticalScrollbar but it had the same result. Can anyone tell me what the correct way to do this is?

Posted: Sun Dec 31, 2006 15:35
by Pompei2
Hello, I got the same issue, did you find any solution ? anybody can help us ?

Edit:
There is one difference: i don't even get these errors ! the scrollbars just don't show up. And i'm using multilined text.

Posted: Sun Dec 31, 2006 16:55
by spannerman
Yes, I think the property has changed at some point. I think it is now VertScrollbar, as in:

Code: Select all

statTxt->setProperty("VertScrollbar", "True");

Posted: Tue Jan 02, 2007 14:44
by Pompei2
Yeah true i figured it out yesterday evening :) everything works fine now, thank you :)

Posted: Tue Jan 09, 2007 14:14
by Sjizo
I did a "kind of" solution. I just tested how many lines I could fit into my text field and would then just delete the first line when too many lines were visible.
Thanx for this answer, it would look much better if it works. Gonna try it later.