Scrolling to the top of a Static Text

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

davidc538
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 01, 2012 16:49

Scrolling to the top of a Static Text

Postby davidc538 » Sun Nov 18, 2012 23:03

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]");


pav
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Thu Dec 01, 2011 14:17

Re: Scrolling to the top of a Static Text

Postby pav » Wed Nov 21, 2012 07:54

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;

?

davidc538
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 01, 2012 16:49

Re: Scrolling to the top of a Static Text

Postby davidc538 » Wed Nov 21, 2012 10:56

yep it should, that worked! thanks!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests