Page 1 of 1

Scrolling to the top of a Static Text

Posted: Sun Nov 18, 2012 23:03
by davidc538
Hello all,

I'm putting together a small application using Ogre and CEGUI and would like to make my static text scroll back to the top with C++ code.

Both ways I've tried throw CEGUI::UnknownObjectException

Code: Select all


      descriptionArea->setText(ss.str());

      CEGUI::ScrollablePane* desc = (CEGUI::ScrollablePane*)&descriptionArea;

                // first way i tried it
      desc->setVerticalScrollPosition(0.f);

                // second way i tried it
      descriptionArea->getProperty("VertScrollPosition");
      descriptionArea->setProperty("VertScrollPosition", "[0]");


Re: Scrolling to the top of a Static Text

Posted: Wed Nov 21, 2012 07:54
by pav
Shouldn't

Code: Select all

descriptionArea->setText(ss.str());
CEGUI::ScrollablePane* desc = (CEGUI::ScrollablePane*)&descriptionArea;

be

Code: Select all

descriptionArea->setText(ss.str());
CEGUI::ScrollablePane* desc = (CEGUI::ScrollablePane*)descriptionArea;

?

Re: Scrolling to the top of a Static Text

Posted: Wed Nov 21, 2012 10:56
by davidc538
yep it should, that worked! thanks!